aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/search_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /test/functional/legacy/search_spec.lua
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'test/functional/legacy/search_spec.lua')
-rw-r--r--test/functional/legacy/search_spec.lua44
1 files changed, 42 insertions, 2 deletions
diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua
index 3f1f85cf28..25620f5262 100644
--- a/test/functional/legacy/search_spec.lua
+++ b/test/functional/legacy/search_spec.lua
@@ -290,8 +290,8 @@ describe('search cmdline', function()
-- First match
feed('/thei')
screen:expect([[
+ 3 the |
4 {inc:thei}r |
- 5 there |
/thei^ |
]])
-- Match from initial cursor position when modifying search
@@ -642,7 +642,7 @@ describe('search cmdline', function()
end)
-- oldtest: Test_incsearch_substitute_dump2()
- it('detects empty pattern properly vim-patch:8.2.2295', function()
+ it('incsearch detects empty pattern properly vim-patch:8.2.2295', function()
screen:try_resize(70, 6)
exec([[
set incsearch hlsearch scrolloff=0
@@ -675,6 +675,46 @@ describe('search cmdline', function()
:1,5s/\v|^ |
]])
end)
+
+ -- oldtest: Test_incsearch_restore_view()
+ it('incsearch restores viewport', function()
+ screen:try_resize(20, 6)
+ exec([[
+ set incsearch nohlsearch
+ setlocal scrolloff=0 smoothscroll
+ call setline(1, [join(range(25), ' '), '', '', '', '', 'xxx'])
+ call feedkeys("2\<C-E>", 't')
+ ]])
+ local s = [[
+ {tilde:<<<} 18 19 20 21 22 2|
+ ^3 24 |
+ |
+ |
+ |
+ |
+ ]]
+ screen:expect(s)
+ feed('/xx')
+ screen:expect([[
+ |
+ |
+ |
+ |
+ {inc:xx}x |
+ /xx^ |
+ ]])
+ feed('x')
+ screen:expect([[
+ |
+ |
+ |
+ |
+ {inc:xxx} |
+ /xxx^ |
+ ]])
+ feed('<Esc>')
+ screen:expect(s)
+ end)
end)
describe('Search highlight', function()