]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0226: No 'incsearch' highlighting support for :uniq v9.2.0226
authorHirohito Higashi <h.east.727@gmail.com>
Sun, 22 Mar 2026 17:00:46 +0000 (17:00 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 22 Mar 2026 17:00:46 +0000 (17:00 +0000)
Problem:  No 'incsearch' highlighting support for :uniq
Solution: Add :uniq support (Hirohito Higashi)

closes: #19780

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_getln.c
src/testdir/dumps/Test_incsearch_uniq_01.dump [new file with mode: 0644]
src/testdir/dumps/Test_incsearch_uniq_02.dump [new file with mode: 0644]
src/testdir/test_search.vim
src/version.c

index 917e67529bf3616f333a34e12c8421e719a148fe..65bd8ccc8f7acb826e57d9d4100efd776ca86d60 100644 (file)
@@ -245,7 +245,7 @@ parse_pattern_and_range(
     // Skip over the range to find the command.
     cmd = skip_range(ea.cmd, TRUE, NULL);
 
-    if (vim_strchr((char_u *)"sgvl", *cmd) == NULL)
+    if (vim_strchr((char_u *)"sgvlu", *cmd) == NULL)
        return FALSE;
 
     // Skip over command name to find pattern separator
diff --git a/src/testdir/dumps/Test_incsearch_uniq_01.dump b/src/testdir/dumps/Test_incsearch_uniq_01.dump
new file mode 100644 (file)
index 0000000..9e6433a
--- /dev/null
@@ -0,0 +1,9 @@
+|a+0&#ffffff0|n|o|t|h|e|r| |o+1&&|n|e+0&&| |2| @56
+|t|h|a|t| |o+0&#ffff4012|n|e+0&#ffffff0| |3| @59
+|t|h|e| |o+0&#ffff4012|n|e+0&#ffffff0| |1| @60
+|~+0#4040ff13&| @68
+|~| @68
+|~| @68
+|~| @68
+|~| @68
+|:+0#0000000&|u|n|i|q| |/|o|n> @60
diff --git a/src/testdir/dumps/Test_incsearch_uniq_02.dump b/src/testdir/dumps/Test_incsearch_uniq_02.dump
new file mode 100644 (file)
index 0000000..6a5b3a9
--- /dev/null
@@ -0,0 +1,9 @@
+|a+0&#ffffff0|n|o|t|h|e|r| |o+1&&|n|e+0&&| |2| @56
+|t|h|a|t| |o+0&#ffff4012|n|e+0&#ffffff0| |3| @59
+|t|h|e| |o+0&#ffff4012|n|e+0&#ffffff0| |1| @60
+|~+0#4040ff13&| @68
+|~| @68
+|~| @68
+|~| @68
+|~| @68
+|:+0#0000000&|u|n|i|q|!| |/|o|n> @59
index a35f380a843f4bcd106a81ec38a42ffc0a8288e3..725d08b59a8be0f5aa6e88c9e8c2b0b4919230e6 100644 (file)
@@ -1319,6 +1319,31 @@ func Test_incsearch_sort_dump()
   call StopVimInTerminal(buf)
 endfunc
 
+" Similar to Test_incsearch_sort_dump() for :uniq
+func Test_incsearch_uniq_dump()
+  CheckOption incsearch
+  CheckScreendump
+
+  call writefile([
+       \ 'set incsearch hlsearch scrolloff=0',
+       \ 'call setline(1, ["another one 2", "that one 3", "the one 1"])',
+       \ ], 'Xis_uniq_script', 'D')
+  let buf = RunVimInTerminal('-S Xis_uniq_script', {'rows': 9, 'cols': 70})
+  " Give Vim a chance to redraw to get rid of the spaces in line 2 caused by
+  " the 'ambiwidth' check.
+  sleep 100m
+
+  call term_sendkeys(buf, ':uniq /on')
+  call VerifyScreenDump(buf, 'Test_incsearch_uniq_01', {})
+  call term_sendkeys(buf, "\<Esc>")
+
+  call term_sendkeys(buf, ':uniq! /on')
+  call VerifyScreenDump(buf, 'Test_incsearch_uniq_02', {})
+  call term_sendkeys(buf, "\<Esc>")
+
+  call StopVimInTerminal(buf)
+endfunc
+
 " Similar to Test_incsearch_substitute_dump() for :vimgrep famiry
 func Test_incsearch_vimgrep_dump()
   CheckOption incsearch
index 5b2396b3cd7d212c62611b3c364b6ac7d9dc3c69..f5693b6a7f21c9d15578b5803ece948d7cda40cb 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    226,
 /**/
     225,
 /**/