[patch] Wrong visual and 'cuc' highlighting in diff mode

0 views
Skip to first unread message

Lech Lorens

unread,
Oct 31, 2009, 7:44:44 PM10/31/09
to vim_dev
The attached patch fixes the incorrect highlighting of the current column
(with 'cuc' set) and the visual blocks in changed/added lines in diff
mode. Such bad behaviour can be observed if the view of the diffed
buffer gets shifted to the right (e.g. with zl) so that the
changed/added line is shorter than the shift offset.

Examples of the described behaviour are depicted in the following screen
shots:
- visual block:
http://llorens.visualserver.org/wrong-cuc-highlight/visual-wrong.png
- current column:
http://llorens.visualserver.org/wrong-cuc-highlight/cuc-wrong.png

While the screen shots should show:
- visual block:
http://llorens.visualserver.org/wrong-cuc-highlight/visual-ok.png
- current column:
http://llorens.visualserver.org/wrong-cuc-highlight/cuc-ok.png

To reproduce the problem invoke vim with the following command line
arguments:
- visual block:
$ vim -u NONE -c 'normal iabcdefghijklmnopqrstuvwxyz' \
-c 'normal yyp' \
-c 'belowright vert new | normal 2pggddp' \
-c 'windo diffthis | normal gg9|5zl 2j2l'

- current column:
$ vim -u NONE -c 'normal iabcdefghijklmnopqrstuvwxyz' \
-c 'normal yyp' \
-c 'belowright vert new | normal 2pggddp' \
-c 'windo diffthis | normal gg9|5zl' \
-c 'set cuc'

--
Cheers,
Lech

wrong-cuc-highlight.patch

Bram Moolenaar

unread,
Nov 1, 2009, 7:59:37 AM11/1/09
to Lech Lorens, vim_dev

Lech Lorens wrote:

Thanks!

--
An indication you must be a manager:
You believe you never have any problems in your life, just
"issues" and "improvement opportunities".

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Reply all
Reply to author
Forward
0 new messages