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 #5017)
diff --git a/src/drawline.c b/src/drawline.c
index 43604c8..ea7764e 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1113,11 +1113,11 @@
// the line number itself.
// TODO: Can we use CursorLine instead of CursorLineNr
// when CursorLineNr isn't set?
- if ((wp->w_p_cul || wp->w_p_rnu)
+ 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)
+ || wp->w_p_culopt_flags & CULOPT_LINE))
char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLN));
#endif
}
diff --git a/src/testdir/test_cursorline.vim b/src/testdir/test_cursorline.vim
index 49df94f..d4a03af 100644
--- a/src/testdir/test_cursorline.vim
+++ b/src/testdir/test_cursorline.vim
@@ -52,7 +52,7 @@
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()
diff --git a/src/version.c b/src/version.c
index 11bfd68..fa4930b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2117,
+/**/
2116,
/**/
2115,