diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-09-27 10:33:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-27 10:33:39 +0200 |
commit | ba17bcfefc626729d30388401b77ef524f9c90d2 (patch) | |
tree | 90a130eaa8b7957d61ab10eb7730e943cbe266d4 /src | |
parent | a1976c7390976e89fc803224488c4ca0d39d35f7 (diff) | |
download | rneovim-ba17bcfefc626729d30388401b77ef524f9c90d2.tar.gz rneovim-ba17bcfefc626729d30388401b77ef524f9c90d2.tar.bz2 rneovim-ba17bcfefc626729d30388401b77ef524f9c90d2.zip |
vim-patch:8.1.0435: cursorline highlight not removed in some situation (#9059)
Problem: Cursorline highlight not removed in some situation. (Vitaly
Yashin)
Solution: Reset last_cursorline when resetting 'cursorline'. (Christian
Brabandt, closes vim/vim#3481)
https://github.com/vim/vim/commit/8c63e0ec314ba07d54b881dc629fe19e6eda1fb8
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/move.c | 5 | ||||
-rw-r--r-- | src/nvim/option.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 4a2874abeb..442e5d6dff 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -98,6 +98,11 @@ static void comp_botline(win_T *wp) static linenr_T last_cursorline = 0; +void reset_cursorline(void) +{ + last_cursorline = 0; +} + // Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set. static void redraw_for_cursorline(win_T *wp) { diff --git a/src/nvim/option.c b/src/nvim/option.c index 7cda42ef20..b4ee89d128 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3705,6 +3705,9 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, } else if ((int *)varp == &p_lnr) { // 'langnoremap' -> !'langremap' p_lrm = !p_lnr; + } else if ((int *)varp == &curwin->w_p_cul && !value && old_value) { + // 'cursorline' + reset_cursorline(); // 'undofile' } else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf) { // Only take action when the option was set. When reset we do not |