changeset 18245:1f5571e7f012 v8.1.2117

patch 8.1.2117: CursorLine highlight used while 'cursorline' is off Commit: https://github.com/vim/vim/commit/49474ca12236776bb56aeb9d39bd6592e28157c7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 5 21:57:12 2019 +0200 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 https://github.com/vim/vim/issues/5017)
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Oct 2019 22:00:03 +0200
parents 59abcab3e712
children 86b2892d767d
files src/drawline.c src/testdir/test_cursorline.vim src/version.c
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1113,11 +1113,11 @@ win_line(
 		      // 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
 		    }
--- a/src/testdir/test_cursorline.vim
+++ b/src/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()
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2117,
+/**/
     2116,
 /**/
     2115,