Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple diff on Venture 13.0.1 #159

Open
diegoholiveira opened this issue Nov 22, 2022 · 2 comments
Open

Apple diff on Venture 13.0.1 #159

diegoholiveira opened this issue Nov 22, 2022 · 2 comments

Comments

@diegoholiveira
Copy link

I'm running MacOS Ventura 13.0.1, and with let g:strip_only_modified_lines=1, the plugin call Apple Diff with 3 removed options:

  • unchanged-group-format
  • old-group-format
  • new-group-format

I found two solutions to this problem:

  1. Install diffutils using Homebrew.
  2. Remove those options from https://github.com/ntpeters/vim-better-whitespace/blob/master/plugin/better-whitespace.vim#L105

I tried the second one and it worked here, but I'm keep the original call and use it with the diff command from diffutils. Should we add in the docs that Apple Diff is not compatible with this plugin or there's a way to safely change the command to work with Apple Diff?

@Cimbali
Copy link
Collaborator

Cimbali commented Nov 23, 2022

You’re probably not getting the right output from apple diff without these options. However maybe there are options to get the right output if we detect that’s the diff being used? We just want the pairs of new/changed lines in the format start,end.

If you diff 2 files with apple diff:

a
b
c

and:

a
f
c
d

What is the output you get? It should be 2,2 4,4 .

@diegoholiveira
Copy link
Author

You're right @Cimbali . The output is not the expected one:

% /usr/bin/diff -a --changed-group-format="%dF,%dL " 1.txt 2.txt
a
%dF,%dL b
c
%dF,%dL %

So, the only true solution of the both that I provided previously is to install diffutils:

% /usr/local/bin/diff -a --unchanged-group-format="" --old-group-format="" --new-group-format="%dF,%dL " --changed-group-format="%dF,%dL " 1.txt 2.txt
2,2 4,4 %

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants