patch 9.1.2069: Search wrap indicator not shown w/out 'shm-S'
Commit:
https://github.com/vim/vim/commit/ccb7b433652eae18550ab0dfb35722cc6bf6234c
Author: glepnir <[email protected]>
Date: Fri Jan 9 16:52:10 2026 +0000
patch 9.1.2069: Search wrap indicator not shown w/out 'shm-S'
Problem: when shortmess doesn't have 'S', backward search wrap doesn't
show the "W" before count. forward search works fine but
backward fails because the position check logic is backwards -
it checks if cursor < pos instead of using the existing
wrapped flag.
Solution: Use sia->sa_wrapped flag that searchit() already sets
correctly (glepnir).
fixes: #5280
closes: #19138
Signed-off-by: glepnir <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/search.c b/src/search.c
index 0855891b0..72d4bbe91 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1618,9 +1618,7 @@ do_search(
if (dircp != NULL)
*dircp = search_delim; // restore second '/' or '?' for normal_cmd()
- if (!shortmess(SHM_SEARCH)
- && ((dirc == '/' && LT_POS(pos, curwin->w_cursor))
- || (dirc == '?' && LT_POS(curwin->w_cursor, pos))))
+ if (!shortmess(SHM_SEARCH) && sia && sia->sa_wrapped)
show_top_bot_msg = TRUE;
if (c == FAIL)
diff --git a/src/testdir/dumps/Test_searchstat_3.dump
b/src/testdir/dumps/Test_searchfoldopen_1.dump
similarity index 100%
rename from src/testdir/dumps/Test_searchstat_3.dump
rename to src/testdir/dumps/Test_searchfoldopen_1.dump
diff --git a/src/testdir/dumps/Test_searchfoldopen_2.dump
b/src/testdir/dumps/Test_searchfoldopen_2.dump
new file mode 100644
index 000000000..f31a12934
--- /dev/null
+++ b/src/testdir/dumps/Test_searchfoldopen_2.dump
@@ -0,0 +1,10 @@
+|i+0&#ffffff0|f| @72
+>++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |f|o@1|-@57
+|e+0#0000000#ffffff0|n|d|i|f| @69
+@75
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|/+0#0000000&|f|o@1| @33|W| |[|1|/|2|]| @11|2|,|2|-|1| @8|A|l@1|
diff --git a/src/testdir/dumps/Test_searchstat_back_1.dump
b/src/testdir/dumps/Test_searchstat_back_1.dump
index 4b2808b97..01ca94827 100644
--- a/src/testdir/dumps/Test_searchstat_back_1.dump
+++ b/src/testdir/dumps/Test_searchstat_back_1.dump
@@ -7,4 +7,4 @@
|~| @73
|~| @73
|~| @73
-|/+0#0000000&|\|<|t|e|s|t|\|>| @30|[|1|/|1|]| @11|1|,|1| @10|A|l@1|
+|/+0#0000000&|\|<|t|e|s|t|\|>| @28|W| |[|1|/|1|]| @11|1|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_searchstat_back_2.dump
b/src/testdir/dumps/Test_searchstat_back_2.dump
index b3c44b092..8aa7698ad 100644
--- a/src/testdir/dumps/Test_searchstat_back_2.dump
+++ b/src/testdir/dumps/Test_searchstat_back_2.dump
@@ -7,4 +7,4 @@
|~| @73
|~| @73
|~| @73
-|?+0#0000000&|\|<|t|e|s|t|\|>| @30|[|1|/|1|]| @11|1|,|1| @10|A|l@1|
+|?+0#0000000&|\|<|t|e|s|t|\|>| @28|W| |[|1|/|1|]| @11|1|,|1| @10|A|l@1|
diff --git a/src/testdir/test_search_stat.vim b/src/testdir/test_search_stat.vim
index 7e16dbd56..b2a81070b 100644
--- a/src/testdir/test_search_stat.vim
+++ b/src/testdir/test_search_stat.vim
@@ -331,13 +331,13 @@ func Test_search_stat_foldopen()
call writefile(lines, 'Xsearchstat1', 'D')
let buf = RunVimInTerminal('-S Xsearchstat1', #{rows: 10})
- call VerifyScreenDump(buf, 'Test_searchstat_3', {})
+ call VerifyScreenDump(buf, 'Test_searchfoldopen_1', {})
call term_sendkeys(buf, "n")
- call VerifyScreenDump(buf, 'Test_searchstat_3', {})
+ call VerifyScreenDump(buf, 'Test_searchfoldopen_2', {})
call term_sendkeys(buf, "n")
- call VerifyScreenDump(buf, 'Test_searchstat_3', {})
+ call VerifyScreenDump(buf, 'Test_searchfoldopen_2', {})
call StopVimInTerminal(buf)
endfunc
diff --git a/src/version.c b/src/version.c
index c922944be..50544f861 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2069,
/**/
2068,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1veFqK-004a6V-B0%40256bit.org.