diff src/drawline.c @ 33316:a2dfcbbfc301 v9.0.1923

patch 9.0.1923: curswant wrong on click with 've' and 'wrap' set Commit: https://github.com/vim/vim/commit/db54e989b5cff3cc6442dfc500e3962cc1c0b6d0 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Sep 21 16:33:09 2023 +0200 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 <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Thu, 21 Sep 2023 16:45:04 +0200
parents 0bb496f81ab2
children e385bda5e345
line wrap: on
line diff
--- 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)
 		{