patch 9.0.1518: search stats not always visible when searching backwards
Problem: Search stats not always visible when searching backwards.
Solution: Do not display the top/bot message on top of the search stats.
(Christian Brabandt, closes #12322, closes #12222)
diff --git a/src/testdir/dumps/Test_searchstat_back_1.dump b/src/testdir/dumps/Test_searchstat_back_1.dump
new file mode 100644
index 0000000..4b2808b
--- /dev/null
+++ b/src/testdir/dumps/Test_searchstat_back_1.dump
@@ -0,0 +1,10 @@
+>t+0&#ffffff0|e|s|t| @70
+@75
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|/+0#0000000&|\|<|t|e|s|t|\|>| @30|[|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
new file mode 100644
index 0000000..b3c44b0
--- /dev/null
+++ b/src/testdir/dumps/Test_searchstat_back_2.dump
@@ -0,0 +1,10 @@
+>t+0&#ffffff0|e|s|t| @70
+@75
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|?+0#0000000&|\|<|t|e|s|t|\|>| @30|[|1|/|1|]| @11|1|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_searchstat_back_3.dump b/src/testdir/dumps/Test_searchstat_back_3.dump
new file mode 100644
index 0000000..ddc3b3d
--- /dev/null
+++ b/src/testdir/dumps/Test_searchstat_back_3.dump
@@ -0,0 +1,10 @@
+>t+0&#ffffff0|e|s|t| @70
+@75
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|s+0#e000002&|e|a|r|c|h| |h|i|t| |T|O|P|,| |c|o|n|t|i|n|u|i|n|g| |a|t| |B|O|T@1|O|M| +0#0000000&@20|1|,|1| @10|A|l@1|
diff --git a/src/testdir/test_search_stat.vim b/src/testdir/test_search_stat.vim
index e205df5..b57b7ba 100644
--- a/src/testdir/test_search_stat.vim
+++ b/src/testdir/test_search_stat.vim
@@ -153,7 +153,6 @@
let g:a = execute(':unsilent :norm! n')
let stat = 'W \[20/1\]'
call assert_match(pat .. stat, g:a)
- call assert_match('search hit BOTTOM, continuing at TOP', g:a)
set norl
endif
@@ -164,7 +163,6 @@
let g:a = execute(':unsilent :norm! N')
let stat = 'W \[20/20\]'
call assert_match(pat .. stat, g:a)
- call assert_match('search hit TOP, continuing at BOTTOM', g:a)
call assert_match('W \[20/20\]', Screenline(&lines))
" normal, no match
@@ -432,5 +430,33 @@
call StopVimInTerminal(buf)
endfunc
+func Test_search_stat_backwards()
+ CheckScreendump
+
+ let lines =<< trim END
+ set shm-=S
+ call setline(1, ['test', ''])
+ END
+ call writefile(lines, 'Xsearchstat_back', 'D')
+
+ let buf = RunVimInTerminal('-S Xsearchstat_back', #{rows: 10})
+ call term_sendkeys(buf, "*")
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_searchstat_back_1', {})
+
+ call term_sendkeys(buf, "N")
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_searchstat_back_2', {})
+
+ call term_sendkeys(buf, ":set shm+=S\<cr>N")
+ call TermWait(buf)
+ " shows "Search Hit Bottom.."
+ call VerifyScreenDump(buf, 'Test_searchstat_back_3', {})
+
+ call term_sendkeys(buf, "\<esc>:qa\<cr>")
+ call TermWait(buf)
+
+ call StopVimInTerminal(buf)
+endfunc
" vim: shiftwidth=2 sts=2 expandtab