]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2069: Search wrap indicator not shown w/out 'shm-S' v9.1.2069
authorglepnir <glephunter@gmail.com>
Fri, 9 Jan 2026 16:52:10 +0000 (16:52 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 9 Jan 2026 16:52:10 +0000 (16:52 +0000)
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>
src/search.c
src/testdir/dumps/Test_searchfoldopen_1.dump [moved from src/testdir/dumps/Test_searchstat_3.dump with 100% similarity]
src/testdir/dumps/Test_searchfoldopen_2.dump [new file with mode: 0644]
src/testdir/dumps/Test_searchstat_back_1.dump
src/testdir/dumps/Test_searchstat_back_2.dump
src/testdir/test_search_stat.vim
src/version.c

index 0855891b0ab874a9f5aa7d998461db51156568dc..72d4bbe91b8293f8225baf2ab79c3632f59d7f0a 100644 (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)
diff --git a/src/testdir/dumps/Test_searchfoldopen_2.dump b/src/testdir/dumps/Test_searchfoldopen_2.dump
new file mode 100644 (file)
index 0000000..f31a129
--- /dev/null
@@ -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| 
index 4b2808b97fd907bee319455615f42197d5623e6e..01ca9482791fdfcde0a57d8d4aa5b67b0fac4c92 100644 (file)
@@ -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| 
index b3c44b09223900fc953879413a756d6f840143c2..8aa7698adc15099ef894aa0607c0ce6ae72c03e3 100644 (file)
@@ -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| 
index 7e16dbd56454b4c956f91321493b3ce45d818a00..b2a81070b6f69ca34484a8b0688d6b69c705cda1 100644 (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
index c922944be7fed6046c086c3881c7db77a9b35b2a..50544f86153e124f9abada23e23f21e95646ac38 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2069,
 /**/
     2068,
 /**/