]> granicus.if.org Git - vim/commitdiff
patch 8.1.2117: CursorLine highlight used while 'cursorline' is off v8.1.2117
authorBram Moolenaar <Bram@vim.org>
Sat, 5 Oct 2019 19:57:12 +0000 (21:57 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 5 Oct 2019 19:57:12 +0000 (21:57 +0200)
Problem:    CursorLine highlight used while 'cursorline' is off.
Solution:   Check 'cursorline' is set. (cloes #5017)

src/drawline.c
src/testdir/test_cursorline.vim
src/version.c

index 43604c8262725692526e10f4f2aba7ebc3aa5738..ea7764ea6275448dacb0dfef235e802aef501c99 100644 (file)
@@ -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
                    }
index 49df94f9066a8f633f708d8189ed8deb89a59b8d..d4a03afd3834839b0503c224860083896a855a84 100644 (file)
@@ -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()
index 11bfd6844652f85195a42911f6d21091d27f311d..fa4930b7ccef0ce48afa6e18cc0483f96868e6f4 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2117,
 /**/
     2116,
 /**/