summaryrefslogtreecommitdiff
path: root/src/move.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-10-02 18:26:10 +0200
committerBram Moolenaar <Bram@vim.org>2018-10-02 18:26:10 +0200
commit4a5abbd6138240d109278fe1f0b45489d22f712d (patch)
treeb564a80ec261f5233d5a14446a69425e9d7391c0 /src/move.c
parent586c70cdfede55a166e3564f1cb68a299d81987d (diff)
downloadvim-git-4a5abbd6138240d109278fe1f0b45489d22f712d.tar.gz
patch 8.1.0448: cursorline not removed when using 'cursorbind'v8.1.0448
Problem: Cursorline not removed when using 'cursorbind'. (Justin Keyes) Solution: Store the last cursor line per window. (closes #3488)
Diffstat (limited to 'src/move.c')
-rw-r--r--src/move.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/move.c b/src/move.c
index cc399ec9e..214c362f4 100644
--- a/src/move.c
+++ b/src/move.c
@@ -117,12 +117,10 @@ comp_botline(win_T *wp)
}
#ifdef FEAT_SYN_HL
-static linenr_T last_cursorline = 0;
-
void
reset_cursorline(void)
{
- last_cursorline = 0;
+ curwin->w_last_cursorline = 0;
}
#endif
@@ -150,18 +148,18 @@ redraw_for_cursorline(win_T *wp)
#ifdef FEAT_SYN_HL
if (wp->w_p_cul)
{
- if (wp->w_redr_type <= VALID && last_cursorline != 0)
+ if (wp->w_redr_type <= VALID && wp->w_last_cursorline != 0)
{
- // "last_cursorline" may be set for another window, worst case
- // we redraw too much. This is optimized for moving the cursor
- // around in the same window.
- redrawWinline(wp, last_cursorline, FALSE);
+ // "w_last_cursorline" may be outdated, worst case we redraw
+ // too much. This is optimized for moving the cursor around in
+ // the current window.
+ redrawWinline(wp, wp->w_last_cursorline, FALSE);
redrawWinline(wp, wp->w_cursor.lnum, FALSE);
redraw_win_later(wp, VALID);
}
else
redraw_win_later(wp, SOME_VALID);
- last_cursorline = wp->w_cursor.lnum;
+ wp->w_last_cursorline = wp->w_cursor.lnum;
}
#endif
}