aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-10-04 19:35:04 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-10-16 00:15:09 +0200
commitee94eecbd4ce9ec3b4371bbe1a2b3cc24cf315d4 (patch)
tree24237923bdbb093dee5d3454e27c37de8b0c303e /src/nvim/move.c
parent8fd092f3ff15bf70f84ec0d716c5aaa2c7379fa1 (diff)
downloadrneovim-ee94eecbd4ce9ec3b4371bbe1a2b3cc24cf315d4.tar.gz
rneovim-ee94eecbd4ce9ec3b4371bbe1a2b3cc24cf315d4.tar.bz2
rneovim-ee94eecbd4ce9ec3b4371bbe1a2b3cc24cf315d4.zip
vim-patch:8.1.0448: cursorline not removed when using 'cursorbind'
Problem: Cursorline not removed when using 'cursorbind'. (Justin Keyes) Solution: Store the last cursor line per window. (closes vim/vim#3488) https://github.com/vim/vim/commit/4a5abbd6138240d109278fe1f0b45489d22f712d
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 442e5d6dff..320f7b7d98 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -96,11 +96,9 @@ static void comp_botline(win_T *wp)
set_empty_rows(wp, done);
}
-static linenr_T last_cursorline = 0;
-
void reset_cursorline(void)
{
- last_cursorline = 0;
+ curwin->w_last_cursorline = 0;
}
// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set.
@@ -114,17 +112,17 @@ static void redraw_for_cursorline(win_T *wp)
redraw_win_later(wp, VALID);
}
if (wp->w_p_cul) {
- if (wp->w_redr_type <= VALID && 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);
+ if (wp->w_redr_type <= VALID && wp->w_last_cursorline != 0) {
+ // "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;
}
}
}