From 37959e88654c6b8e49de493231f6ff780adab67c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 3 Jul 2021 23:06:30 -0400 Subject: vim-patch:8.2.3088: with 'virtualedit' set to "block" Visual highlight is wrong Problem: With 'virtualedit' set to "block" Visual highlight is wrong after using "$". (Marco Trosi) Solution: Do not set w_old_cursor_lcol to MAXCOL. (closes vim/vim#8495) https://github.com/vim/vim/commit/9cee4a1c9c69542ccd73bcd2db05920150856361 --- src/nvim/screen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/nvim/screen.c') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 3446a944cd..cab41d1783 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1186,9 +1186,12 @@ static void win_update(win_T *wp, Providers *providers) getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); ve_flags = save_ve_flags; - ++toc; - if (curwin->w_curswant == MAXCOL) + toc++; + // Highlight to the end of the line, unless 'virtualedit' has + // "block". + if (curwin->w_curswant == MAXCOL && !(ve_flags & VE_BLOCK)) { toc = MAXCOL; + } if (fromc != wp->w_old_cursor_fcol || toc != wp->w_old_cursor_lcol) { -- cgit