aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-21 06:55:28 +0800
committerGitHub <noreply@github.com>2022-04-21 06:55:28 +0800
commit61eca90f653f6788374c2c5c177d809e6bb5a40c (patch)
treee724eda0cf298123b3410d3d96350d845a35d159 /src/nvim/testdir
parentbfd6eb4404d7250d1b59fc24f08a9392fba0c043 (diff)
parent81453579745516316067ba8154eb02e1305114fc (diff)
downloadrneovim-61eca90f653f6788374c2c5c177d809e6bb5a40c.tar.gz
rneovim-61eca90f653f6788374c2c5c177d809e6bb5a40c.tar.bz2
rneovim-61eca90f653f6788374c2c5c177d809e6bb5a40c.zip
Merge pull request #18187 from zeertzjq/vim-8.2.4724
vim-patch:8.2.4724: current instance of last search pattern not easily spotted
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_search.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 8154bd9c4d..6ccc151294 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -946,6 +946,34 @@ func Test_incsearch_substitute()
call Incsearch_cleanup()
endfunc
+func Test_hlsearch_cursearch()
+ CheckScreendump
+
+ let lines =<< trim END
+ set hlsearch scrolloff=0
+ call setline(1, ['one', 'foo', 'bar', 'baz', 'foo', 'bar'])
+ hi Search ctermbg=yellow
+ hi CurSearch ctermbg=blue
+ END
+ call writefile(lines, 'Xhlsearch_cursearch')
+ let buf = RunVimInTerminal('-S Xhlsearch_cursearch', {'rows': 9, 'cols': 60})
+
+ call term_sendkeys(buf, "gg/foo\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_1', {})
+
+ call term_sendkeys(buf, "n")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2', {})
+
+ call term_sendkeys(buf, "?\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_3', {})
+
+ call term_sendkeys(buf, "gg/foo\\nbar\<CR>")
+ call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line', {})
+
+ call StopVimInTerminal(buf)
+ call delete('Xhlsearch_cursearch')
+endfunc
+
" Similar to Test_incsearch_substitute() but with a screendump halfway.
func Test_incsearch_substitute_dump()
CheckOption incsearch