diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-24 18:53:28 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-24 19:03:23 +0800 |
commit | e38ae3b74ff513d991f8212dfbba75fe8c66aad3 (patch) | |
tree | 25702f3efbf45f7f287fdee2162883b2b4391656 /test | |
parent | 81c87857f632d1afe147e9b77a97da38f8f3a887 (diff) | |
download | rneovim-e38ae3b74ff513d991f8212dfbba75fe8c66aad3.tar.gz rneovim-e38ae3b74ff513d991f8212dfbba75fe8c66aad3.tar.bz2 rneovim-e38ae3b74ff513d991f8212dfbba75fe8c66aad3.zip |
vim-patch:8.2.3940: match highlight disappears when doing incsearch for ":s/pat"
Problem: Match highlight disappears when doing incsearch for ":s/pat".
Solution: Only use line limit for incsearch highlighting. (closes vim/vim#9425)
https://github.com/vim/vim/commit/94fb8274ca8c93a10102d41c8bcc848f75cb7334
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/match_spec.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua index eab2bff70a..51cd60864e 100644 --- a/test/functional/legacy/match_spec.lua +++ b/test/functional/legacy/match_spec.lua @@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear = helpers.clear local exec = helpers.exec +local feed = helpers.feed before_each(clear) @@ -64,4 +65,36 @@ describe('match highlighting', function() | ]]) end) + + it('is shown with incsearch vim-patch:8.2.3940', function() + local screen = Screen.new(75, 6) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {background = Screen.colors.Yellow}, -- Search + [2] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg + }) + screen:attach() + exec([[ + set incsearch + call setline(1, range(20)) + call matchaddpos('ErrorMsg', [3]) + ]]) + screen:expect([[ + ^0 | + 1 | + {2:2} | + 3 | + 4 | + | + ]]) + feed(':s/0') + screen:expect([[ + {1:0} | + 1 | + {2:2} | + 3 | + 4 | + :s/0^ | + ]]) + end) end) |