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 <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2026-01-09 16:52:10 +00:00
committed by Christian Brabandt
parent 27e5d95edf
commit ccb7b43365
7 changed files with 18 additions and 8 deletions
+1 -3
View File
@@ -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)
@@ -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|
@@ -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|
@@ -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|
+3 -3
View File
@@ -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
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2069,
/**/
2068,
/**/