aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-04-19 18:56:51 +0200
committerGitHub <noreply@github.com>2022-04-19 18:56:51 +0200
commitdbc4af71861bf2d3bac6974a0bdb99b18a13666a (patch)
treee9baf3d0c05e38dacc5543c5187b1f6e88562790 /test
parent0124a7bfa9e27796e561cb0b3a045b9327bf7077 (diff)
parentb16afe4d556af7c3e86b311cfffd1c68a5eed71f (diff)
downloadrneovim-dbc4af71861bf2d3bac6974a0bdb99b18a13666a.tar.gz
rneovim-dbc4af71861bf2d3bac6974a0bdb99b18a13666a.tar.bz2
rneovim-dbc4af71861bf2d3bac6974a0bdb99b18a13666a.zip
Merge pull request #18081 from famiu/feat/highlight/cursearch
feat(highlight): implement CurSearch highlight
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/cursor_spec.lua4
-rw-r--r--test/functional/ui/searchhl_spec.lua50
2 files changed, 52 insertions, 2 deletions
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua
index 4c51547e2c..92300a8fa2 100644
--- a/test/functional/ui/cursor_spec.lua
+++ b/test/functional/ui/cursor_spec.lua
@@ -212,10 +212,10 @@ describe('ui/cursor', function()
if m.blinkwait then m.blinkwait = 700 end
end
if m.hl_id then
- m.hl_id = 61
+ m.hl_id = 62
m.attr = {background = Screen.colors.DarkGray}
end
- if m.id_lm then m.id_lm = 62 end
+ if m.id_lm then m.id_lm = 63 end
end
-- Assert the new expectation.
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 2e60930127..068a77a2e4 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -109,6 +109,56 @@ describe('search highlighting', function()
]])
end)
+ it('works for match under cursor', function()
+ screen:set_default_attr_ids({
+ [1] = {background = Screen.colors.Yellow},
+ [2] = {foreground = Screen.colors.Gray100, background = Screen.colors.Gray0},
+ [3] = {foreground = Screen.colors.Red},
+ })
+
+ command('highlight CurSearch guibg=Black guifg=White')
+ insert([[
+ There is no way that a bee should be
+ able to fly. Its wings are too small
+ to get its fat little body off the
+ ground. The bee, of course, flies
+ anyway because bees don't care what
+ humans think is impossible.]])
+
+ feed('/bee<CR>')
+ screen:expect{grid=[[
+ There is no way that a {2:^bee} should be |
+ able to fly. Its wings are too small |
+ to get its fat little body off the |
+ ground. The {1:bee}, of course, flies |
+ anyway because {1:bee}s don't care what |
+ humans think is impossible. |
+ {3:search hit BOTTOM, continuing at TOP} |
+ ]]}
+
+ feed('nn')
+ screen:expect{grid=[[
+ There is no way that a {1:bee} should be |
+ able to fly. Its wings are too small |
+ to get its fat little body off the |
+ ground. The {1:bee}, of course, flies |
+ anyway because {2:^bee}s don't care what |
+ humans think is impossible. |
+ /bee |
+ ]]}
+
+ feed('N')
+ screen:expect{grid=[[
+ There is no way that a {1:bee} should be |
+ able to fly. Its wings are too small |
+ to get its fat little body off the |
+ ground. The {2:^bee}, of course, flies |
+ anyway because {1:bee}s don't care what |
+ humans think is impossible. |
+ ?bee |
+ ]]}
+ end)
+
it('highlights after EOL', function()
insert("\n\n\n\n\n\n")