aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-21 19:59:25 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-04-21 20:19:58 +0800
commit4b19f94c2800b6ab89db57919d35c9696f48cef7 (patch)
tree42fa6fe12cd07542605c96c595f75dbc65314975 /test
parente6dec30332f2538ae45d58e6bb674c8a28422fe9 (diff)
downloadrneovim-4b19f94c2800b6ab89db57919d35c9696f48cef7.tar.gz
rneovim-4b19f94c2800b6ab89db57919d35c9696f48cef7.tar.bz2
rneovim-4b19f94c2800b6ab89db57919d35c9696f48cef7.zip
vim-patch:8.2.4759: CurSearch highlight does not work for multi-line match
Problem: CurSearch highlight does not work for multi-line match. Solution: Check cursor position before adjusting columns. (closes vim/vim#10133) https://github.com/vim/vim/commit/693ccd11606b59eb0f81c6c1948679e61ada4022
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/searchhl_spec.lua109
1 files changed, 62 insertions, 47 deletions
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index a08db3e5e7..84dc3c59bb 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -163,53 +163,68 @@ describe('search highlighting', function()
end)
it('works for multiline match', function()
- insert([[
- one
- foo
- bar
- baz
- foo
- bar]])
- feed('gg/foo<CR>')
- screen:expect([[
- one |
- {2:^foo} |
- bar |
- baz |
- {1:foo} |
- bar |
- /foo |
- ]])
- feed('n')
- screen:expect([[
- one |
- {1:foo} |
- bar |
- baz |
- {2:^foo} |
- bar |
- /foo |
- ]])
- feed('?<CR>')
- screen:expect([[
- one |
- {2:^foo} |
- bar |
- baz |
- {1:foo} |
- bar |
- ?foo |
- ]])
- feed('gg/foo\\nbar<CR>')
- screen:expect([[
- one |
- {2:^foo} |
- {1:bar} |
- baz |
- {1:foo} |
- {1:bar} |
- /foo\nbar |
- ]])
+ command([[call setline(1, ['one', 'foo', 'bar', 'baz', 'foo', 'bar'])]])
+ feed('gg/foo<CR>')
+ screen:expect([[
+ one |
+ {2:^foo} |
+ bar |
+ baz |
+ {1:foo} |
+ bar |
+ /foo |
+ ]])
+ feed('n')
+ screen:expect([[
+ one |
+ {1:foo} |
+ bar |
+ baz |
+ {2:^foo} |
+ bar |
+ /foo |
+ ]])
+ feed('?<CR>')
+ screen:expect([[
+ one |
+ {2:^foo} |
+ bar |
+ baz |
+ {1:foo} |
+ bar |
+ ?foo |
+ ]])
+ feed('gg/foo\\nbar<CR>')
+ screen:expect([[
+ one |
+ {2:^foo} |
+ {2:bar} |
+ baz |
+ {1:foo} |
+ {1:bar} |
+ /foo\nbar |
+ ]])
+ command([[call setline(1, ['---', 'abcdefg', 'hijkl', '---', 'abcdefg', 'hijkl'])]])
+ feed('gg/efg\\nhij<CR>')
+ screen:expect([[
+ --- |
+ abcd{2:^efg} |
+ {2:hij}kl |
+ --- |
+ abcd{1:efg} |
+ {1:hij}kl |
+ /efg\nhij |
+ ]])
+ feed('n')
+ screen:expect([[
+ --- |
+ abcd{1:efg} |
+ {1:hij}kl |
+ --- |
+ abcd{2:^efg} |
+ {2:hij}kl |
+ /efg\nhij |
+ ]])
end)
end)