Friday, February 23, 2018

Re: vimdiff - how to jump to next difference in long line - shortcut ]c does not work

On Fri, Feb 23, 2018 at 9:43 AM, Igor Forca <igor2x@gmail.com> wrote:
@Arun, I have tested your code in deep. It is working perfectly. What I have found is little trouble in the case when first line include the change.

File1:
aaa ccc
aaa ccc

File2:
aaa bbb
aaa bbb

If cursor is in file1 at first line first column, diff enabled and pressing ]x I expect cursor to jump to first line first c letter, but it jumps to second line first c character. It looks this problem only appears if difference is in first line. If difference is any other line but first one the problem does not appear.


That is expected, the script searches by going down a line first, so hits on the current line will be missed. Optimizing for that case was not worth the changes it introduced.

As for the difference between the mappings ]c and ]x, the former goes over all diff context (addition, deletion), where as the latter would only look for DiffChanges. If your diff buffer does not have any additions or deletions, both would behave the same.

Regards,
-Arun

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment