diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /test/functional/legacy/search_spec.lua | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-usermarks.tar.gz rneovim-usermarks.tar.bz2 rneovim-usermarks.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'test/functional/legacy/search_spec.lua')
-rw-r--r-- | test/functional/legacy/search_spec.lua | 73 |
1 files changed, 68 insertions, 5 deletions
diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 67991f5d48..3f1f85cf28 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -14,7 +14,7 @@ describe('search cmdline', function() before_each(function() clear() - command('set nohlsearch') + command('set nohlsearch inccommand=') screen = Screen.new(20, 3) screen:attach() screen:set_default_attr_ids({ @@ -472,8 +472,8 @@ describe('search cmdline', function() funcs.winsaveview()) end) + -- oldtest: Test_search_cmdline4(). it("CTRL-G with 'incsearch' and ? goes in the right direction", function() - -- oldtest: Test_search_cmdline4(). screen:try_resize(40, 4) command('enew!') funcs.setline(1, {' 1 the first', ' 2 the second', ' 3 the third'}) @@ -573,8 +573,8 @@ describe('search cmdline', function() ]]) end) + -- oldtest: Test_incsearch_sort_dump(). it('incsearch works with :sort', function() - -- oldtest: Test_incsearch_sort_dump(). screen:try_resize(20, 4) command('set incsearch hlsearch scrolloff=0') funcs.setline(1, {'another one 2', 'that one 3', 'the one 1'}) @@ -589,8 +589,8 @@ describe('search cmdline', function() feed('<esc>') end) + -- oldtest: Test_incsearch_vimgrep_dump(). it('incsearch works with :vimgrep family', function() - -- oldtest: Test_incsearch_vimgrep_dump(). screen:try_resize(30, 4) command('set incsearch hlsearch scrolloff=0') funcs.setline(1, {'another one 2', 'that one 3', 'the one 1'}) @@ -640,11 +640,74 @@ describe('search cmdline', function() ]]) feed('<esc>') end) + + -- oldtest: Test_incsearch_substitute_dump2() + it('detects empty pattern properly vim-patch:8.2.2295', function() + screen:try_resize(70, 6) + exec([[ + set incsearch hlsearch scrolloff=0 + for n in range(1, 4) + call setline(n, "foo " . n) + endfor + call setline(5, "abc|def") + 3 + ]]) + + feed([[:%s/\vabc|]]) + screen:expect([[ + foo 1 | + foo 2 | + foo 3 | + foo 4 | + abc|def | + :%s/\vabc|^ | + ]]) + feed('<Esc>') + + -- The following should not be highlighted + feed([[:1,5s/\v|]]) + screen:expect([[ + foo 1 | + foo 2 | + foo 3 | + foo 4 | + abc|def | + :1,5s/\v|^ | + ]]) + end) end) describe('Search highlight', function() before_each(clear) - it('Search highlight is combined with Visual highlight vim-patch:8.2.2797', function() + + -- oldtest: Test_hlsearch_dump() + it('beyond line end vim-patch:8.2.2542', function() + local screen = Screen.new(50, 6) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [2] = {background = Screen.colors.Yellow}, -- Search + [3] = {background = Screen.colors.Grey90}, -- CursorLine + }) + screen:attach() + exec([[ + set hlsearch noincsearch cursorline + call setline(1, ["xxx", "xxx", "xxx"]) + /.* + 2 + ]]) + feed([[/\_.*<CR>]]) + screen:expect([[ + {2:xxx } | + {2:xxx } | + {2:^xxx }{3: }| + {1:~ }| + {1:~ }| + /\_.* | + ]]) + end) + + -- oldtest: Test_hlsearch_and_visual() + it('is combined with Visual highlight vim-patch:8.2.2797', function() local screen = Screen.new(40, 6) screen:set_default_attr_ids({ [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText |