diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-07-03 23:06:30 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-07-04 09:22:50 -0400 |
commit | 37959e88654c6b8e49de493231f6ff780adab67c (patch) | |
tree | 84d7b37cac5ca45adab8d016670fecc949cd63d6 /src/nvim/screen.c | |
parent | c2a7e445ce6652e986b2018c62cc1d54a9691b29 (diff) | |
download | rneovim-37959e88654c6b8e49de493231f6ff780adab67c.tar.gz rneovim-37959e88654c6b8e49de493231f6ff780adab67c.tar.bz2 rneovim-37959e88654c6b8e49de493231f6ff780adab67c.zip |
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
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |