summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-21 16:33:09 +0200
committerChristian Brabandt <cb@256bit.org>2023-09-21 16:33:09 +0200
commitdb54e989b5cff3cc6442dfc500e3962cc1c0b6d0 (patch)
treef25258b3b57a48831842789bf08f9b0f8bce7d70 /src/drawline.c
parenta7aba6ca5033a85839d997d29d5ca88a1f2acf8f (diff)
patch 9.0.1923: curswant wrong on click with 've' and 'wrap' setv9.0.1923
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>
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c17
1 files changed, 13 insertions, 4 deletions
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)
{