diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-08-01 07:09:51 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2021-08-02 05:41:17 +0800 |
commit | 56b437a6c7a050921653a0d9e091777682db31ea (patch) | |
tree | 4c4037d4956c6be80c6baddbb2b244423c60eccc /src | |
parent | 1666fe9dfe08201c92271b7a59fb2f96a20eb8db (diff) | |
download | rneovim-56b437a6c7a050921653a0d9e091777682db31ea.tar.gz rneovim-56b437a6c7a050921653a0d9e091777682db31ea.tar.bz2 rneovim-56b437a6c7a050921653a0d9e091777682db31ea.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_cursorline.vim | 2 |
2 files changed, 3 insertions, 3 deletions
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() |