aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/searchhl_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/searchhl_spec.lua')
-rw-r--r--test/functional/ui/searchhl_spec.lua34
1 files changed, 32 insertions, 2 deletions
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 8bdf528412..eab265cbb1 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -197,7 +197,8 @@ describe('search highlighting', function()
}
end)
- it('works for multiline match', function()
+ -- oldtest: Test_hlsearch_cursearch()
+ it('works for multiline match, no duplicate highlight', function()
command([[call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar'])]])
feed('gg/foo<CR>')
screen:expect([[
@@ -281,6 +282,28 @@ describe('search highlighting', function()
{2:hij}kl |
/efg\nhij |
]])
+
+ -- check clearing CurSearch when using it for another match
+ feed('G?^abcd<CR>Y')
+ screen:expect([[
+ --- |
+ {1:abcd}efg |
+ hijkl |
+ --- |
+ {2:^abcd}efg |
+ hijkl |
+ ?^abcd |
+ ]])
+ feed('kkP')
+ screen:expect([[
+ --- |
+ {1:abcd}efg |
+ {2:^abcd}efg |
+ hijkl |
+ --- |
+ {1:abcd}efg |
+ ?^abcd |
+ ]])
end)
end)
@@ -345,12 +368,19 @@ describe('search highlighting', function()
bar baz foo
bar foo baz]])
feed('/foo')
+ screen:set_default_attr_ids({
+ [1] = { bold = true, foreground = Screen.colors.Blue },
+ [2] = { background = Screen.colors.Yellow }, -- Search
+ [3] = { reverse = true },
+ [4] = { bold = true, reverse = true },
+ [5] = { foreground = Screen.colors.White, background = Screen.colors.DarkGreen },
+ })
screen:expect([[
{3:foo} bar baz │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
bar baz {2:foo} │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
bar {2:foo} baz │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
{1:~ }│{MATCH:.*}|*2
- {5:[No Name] [+] }{3:term }|
+ {4:[No Name] [+] }{5:term }|
/foo^ |
]])
end)