]> granicus.if.org Git - vim/commitdiff
patch 8.1.0280: 'incsearch' highlighting does not work for ":g!/" v8.1.0280
authorBram Moolenaar <Bram@vim.org>
Mon, 13 Aug 2018 20:54:35 +0000 (22:54 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 13 Aug 2018 20:54:35 +0000 (22:54 +0200)
Problem:    'incsearch' highlighting does not work for ":g!/".
Solution:   Skip the exclamation mark. (Hirohito Higashi)

src/ex_getln.c
src/testdir/test_search.vim
src/version.c

index 8765ac5b246ff00701b81d8488f3d514effdf31c..fb16743f0c01fe18163e795dcc651680986740c7 100644 (file)
@@ -298,6 +298,13 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
                            || STRNCMP(cmd, "global", p - cmd) == 0
                            || STRNCMP(cmd, "vglobal", p - cmd) == 0))
                {
+                   // Check for "global!/".
+                   if (*cmd == 'g' && *p == '!')
+                   {
+                       p++;
+                       if (*skipwhite(p) == NUL)
+                           return FALSE;
+                   }
                    p = skipwhite(p);
                    delim = *p++;
                    end = skip_regexp(p, delim, p_magic, NULL);
index 05046b3c0f74faa80576b4a52c1040ea153b7a0e..8d4b7cc604bec6b91367305b8bbb7975fd58a540 100644 (file)
@@ -399,6 +399,14 @@ func Test_search_cmdline3g()
   undo
   call feedkeys(":global/the\<c-l>/d\<cr>", 'tx')
   call assert_equal('  3 the theother', getline(2))
+  undo
+  call feedkeys(":g!/the\<c-l>/d\<cr>", 'tx')
+  call assert_equal(1, line('$'))
+  call assert_equal('  2 the~e', getline(1))
+  undo
+  call feedkeys(":global!/the\<c-l>/d\<cr>", 'tx')
+  call assert_equal(1, line('$'))
+  call assert_equal('  2 the~e', getline(1))
 
   call Incsearch_cleanup()
 endfunc
index 4a9dd1423264d6ad5e732b0b3a1bfb009eb66d08..1450992209e016bdedad1d592f9ae0ed7bcef71a 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    280,
 /**/
     279,
 /**/