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)
{
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)
{
call feedkeys("\<LeftMouse>", "xt")
call assert_equal([0, 1, 10, 2, 15], getcurpos())
+ setlocal nowrap
+ call setline(2, repeat('a', 19))
+ normal! j14zl
+ redraw
+ call test_setmouse(row, 21 + 1)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 1, 10, 2, 15], getcurpos())
+ call test_setmouse(row, 21 + 11)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 1, 10, 12, 25], getcurpos())
+ call test_setmouse(row + 1, 21 + 1)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 15, 0, 15], getcurpos())
+ call test_setmouse(row + 1, 21 + 11)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 20, 5, 25], getcurpos())
+
+ setlocal number numberwidth=2
+ redraw
+ call test_setmouse(row, 21 + 3)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 1, 10, 2, 15], getcurpos())
+ call test_setmouse(row, 21 + 13)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 1, 10, 12, 25], getcurpos())
+ call test_setmouse(row + 1, 21 + 3)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 15, 0, 15], getcurpos())
+ call test_setmouse(row + 1, 21 + 13)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 20, 5, 25], getcurpos())
+ setlocal nonumber
+
+ if has('signs')
+ sign define Sign1 text=口
+ sign place 1 name=Sign1 line=1
+ sign place 2 name=Sign1 line=2
+ redraw
+ call test_setmouse(row, 21 + 3)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 1, 10, 2, 15], getcurpos())
+ call test_setmouse(row, 21 + 13)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 1, 10, 12, 25], getcurpos())
+ call test_setmouse(row + 1, 21 + 3)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 15, 0, 15], getcurpos())
+ call test_setmouse(row + 1, 21 + 13)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 20, 5, 25], getcurpos())
+ sign unplace 1
+ sign unplace 2
+ sign undefine Sign1
+ endif
+
bwipe!
let &mouse = save_mouse
set virtualedit&