From db54e989b5cff3cc6442dfc500e3962cc1c0b6d0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 21 Sep 2023 16:33:09 +0200 Subject: patch 9.0.1923: curswant wrong on click with 've' and 'wrap' set Problem: curswant wrong on click with 've' and 'wrap' set Solution: Add w_leftcol to mouse click column. closes: #13142 Signed-off-by: Christian Brabandt Co-authored-by: zeertzjq --- src/drawline.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/drawline.c') diff --git a/src/drawline.c b/src/drawline.c index 6f9044650a..95ea3f025a 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -3852,7 +3852,14 @@ win_line( else ScreenAttrs[wlv.off] = wlv.char_attr; - ScreenCols[wlv.off] = wlv.vcol; + if (wlv.draw_state > WL_NR +#ifdef FEAT_DIFF + && wlv.filler_todo <= 0 +#endif + ) + ScreenCols[wlv.off] = wlv.vcol; + else + ScreenCols[wlv.off] = -1; if (has_mbyte && (*mb_char2cells)(mb_c) > 1) { @@ -3865,19 +3872,21 @@ win_line( else // DBCS: Put second byte in the second screen char. ScreenLines[wlv.off] = mb_c & 0xff; + if (wlv.draw_state > WL_NR #ifdef FEAT_DIFF && wlv.filler_todo <= 0 #endif ) - ++wlv.vcol; + ScreenCols[wlv.off] = ++wlv.vcol; + else + ScreenCols[wlv.off] = -1; + // When "wlv.tocol" is halfway a character, set it to the end // of the character, otherwise highlighting won't stop. if (wlv.tocol == wlv.vcol) ++wlv.tocol; - ScreenCols[wlv.off] = wlv.vcol; - #ifdef FEAT_RIGHTLEFT if (wp->w_p_rl) { -- cgit v1.2.3