From 56b437a6c7a050921653a0d9e091777682db31ea Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 1 Aug 2021 07:09:51 +0800 Subject: vim-patch:8.1.2117: CursorLine highlight used while 'cursorline' is off Problem: CursorLine highlight used while 'cursorline' is off. Solution: Check 'cursorline' is set. (cloes vim/vim#5017) https://github.com/vim/vim/commit/49474ca12236776bb56aeb9d39bd6592e28157c7 --- src/nvim/screen.c | 4 ++-- src/nvim/testdir/test_cursorline.vim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index dd9b889746..6fda44f5eb 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2809,11 +2809,11 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, if (num_sattr != NULL) { // :sign defined with "numhl" highlight. char_attr = num_sattr->sat_numhl; - } else if ((wp->w_p_cul || wp->w_p_rnu) + } else if (wp->w_p_cul + && lnum == wp->w_cursor.lnum && (wp->w_p_culopt_flags & CULOPT_NBR) && (row == startrow || wp->w_p_culopt_flags & CULOPT_LINE) - && lnum == wp->w_cursor.lnum && filler_todo == 0) { // When 'cursorline' is set highlight the line number of // the current line differently. diff --git a/src/nvim/testdir/test_cursorline.vim b/src/nvim/testdir/test_cursorline.vim index 49df94f906..d4a03afd38 100644 --- a/src/nvim/testdir/test_cursorline.vim +++ b/src/nvim/testdir/test_cursorline.vim @@ -52,7 +52,7 @@ func Test_cursorline_highlight1() setl nocursorline relativenumber redraw let attr31 = s:screen_attr(1) - call assert_equal(attr21[0:3], attr31[0:3]) + call assert_equal(attr22[0:3], attr31[0:3]) call assert_equal(attr11[4:7], attr31[4:7]) call s:close_windows() -- cgit