From 9cee4a1c9c69542ccd73bcd2db05920150856361 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 3 Jul 2021 15:08:37 +0200 Subject: 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 #8495) --- src/drawscreen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/drawscreen.c') diff --git a/src/drawscreen.c b/src/drawscreen.c index bb0d8878e8..77a8a7b276 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -2007,7 +2007,9 @@ win_update(win_T *wp) ve_flags = save_ve_flags; #endif ++toc; - if (curwin->w_curswant == MAXCOL) + // 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 -- cgit v1.2.3