From d21e6285e93302b6d387ad6d362b683db09c5239 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 07:18:39 +0800 Subject: vim-patch:9.0.1759: Visual highlight not working with cursor at end of screen line (#24806) Problem: Visual highlight not working with cursor at end of screen line and 'showbreak'. Solution: Only update "vcol_prev" when drawing buffer text. closes: vim/vim#12865 https://github.com/vim/vim/commit/8fc6a1dae07aa63faa6bfe6ed93888635745830c --- src/nvim/drawline.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index e531704970..753baa2675 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -2940,9 +2940,12 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl wlv.char_attr = hl_combine_attr(wlv.line_attr_lowprio, wlv.char_attr); } + if (wlv.draw_state == WL_LINE) { + vcol_prev = wlv.vcol; + } + // Store character to be displayed. // Skip characters that are left of the screen for 'nowrap'. - vcol_prev = wlv.vcol; if (wlv.draw_state < WL_LINE || n_skip <= 0) { // Store the character. if (wp->w_p_rl && utf_char2cells(mb_c) > 1) { -- cgit