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)
8c63e0ec31
This commit is contained in:
Justin M. Keyes 2018-09-27 10:33:39 +02:00 committed by GitHub
parent a1976c7390
commit ba17bcfefc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -98,6 +98,11 @@ static void comp_botline(win_T *wp)
static linenr_T last_cursorline = 0; 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. // Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set.
static void redraw_for_cursorline(win_T *wp) static void redraw_for_cursorline(win_T *wp)
{ {

View File

@ -3705,6 +3705,9 @@ static char *set_bool_option(const int opt_idx, char_u *const varp,
} else if ((int *)varp == &p_lnr) { } else if ((int *)varp == &p_lnr) {
// 'langnoremap' -> !'langremap' // 'langnoremap' -> !'langremap'
p_lrm = !p_lnr; p_lrm = !p_lnr;
} else if ((int *)varp == &curwin->w_p_cul && !value && old_value) {
// 'cursorline'
reset_cursorline();
// 'undofile' // 'undofile'
} else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf) { } 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 // Only take action when the option was set. When reset we do not