]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.0344: 'hlsearch' highlighting has a gap after /$ v8.1.0344
authorBram Moolenaar <Bram@vim.org>
Sun, 2 Sep 2018 13:07:28 +0000 (15:07 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 2 Sep 2018 13:07:28 +0000 (15:07 +0200)
Problem:    'hlsearch' highlighting has a gap after /$.
Solution:   Remove suspicious code. (Ricky Zhou, closes #3400)

src/screen.c
src/testdir/test_hlsearch.vim
src/version.c

index 410772ac57696153663e8e165e149555d855fa90..743c321c476b00ab37709b2251acc6c99e494e17 100644 (file)
@@ -5496,15 +5496,6 @@ win_line(
        if (c == NUL)
        {
 #ifdef FEAT_SYN_HL
-           if (eol_hl_off > 0 && vcol - eol_hl_off == (long)wp->w_virtcol
-                   && lnum == wp->w_cursor.lnum)
-           {
-               /* highlight last char after line */
-               --col;
-               --off;
-               --vcol;
-           }
-
            /* Highlight 'cursorcolumn' & 'colorcolumn' past end of the line. */
            if (wp->w_p_wrap)
                v = wp->w_skipcol;
index db7a937da34331c662ed0d23be80bf66a736235d..0b59440594bffa563bd823c35e987c387c259076 100644 (file)
@@ -4,7 +4,6 @@ function! Test_hlsearch()
   new
   call setline(1, repeat(['aaa'], 10))
   set hlsearch nolazyredraw
-  let r=[]
   " redraw is needed to make hlsearch highlight the matches
   exe "normal! /aaa\<CR>" | redraw
   let r1 = screenattr(1, 1)
@@ -51,3 +50,16 @@ func Test_hlsearch_hangs()
   set nohlsearch redrawtime&
   bwipe!
 endfunc
+
+func Test_hlsearch_eol_highlight()
+  new
+  call append(1, repeat([''], 9))
+  set hlsearch nolazyredraw
+  exe "normal! /$\<CR>" | redraw
+  let attr = screenattr(1, 1)
+  for row in range(2, 10)
+    call assert_equal(attr, screenattr(row, 1), 'in line ' . row)
+  endfor
+  set nohlsearch
+  bwipe!
+endfunc
index 1077b9abeee3fa724c55a2ce74c5481efd454293..b1e76e50a0d08ea5aff5c3a74ff9959ffb0fd980 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    344,
 /**/
     343,
 /**/