diff options
Diffstat (limited to 'test/functional/ui/searchhl_spec.lua')
-rw-r--r-- | test/functional/ui/searchhl_spec.lua | 50 |
1 files changed, 50 insertions, 0 deletions
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") |