aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/ui_event_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
commit9be89f131f87608f224f0ee06d199fcd09d32176 (patch)
tree11022dcfa9e08cb4ac5581b16734196128688d48 /test/functional/lua/ui_event_spec.lua
parentff7ed8f586589d620a806c3758fac4a47a8e7e15 (diff)
parent88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff)
downloadrneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.gz
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.bz2
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/lua/ui_event_spec.lua')
-rw-r--r--test/functional/lua/ui_event_spec.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua
index 1e80c88403..0a6deaa41c 100644
--- a/test/functional/lua/ui_event_spec.lua
+++ b/test/functional/lua/ui_event_spec.lua
@@ -37,6 +37,9 @@ describe('vim.ui_attach', function()
[2] = { bold = true },
[3] = { background = Screen.colors.Grey },
[4] = { background = Screen.colors.LightMagenta },
+ [5] = { reverse = true },
+ [6] = { reverse = true, bold = true },
+ [7] = { background = Screen.colors.Yellow1 },
})
screen:attach()
end)
@@ -188,6 +191,56 @@ describe('vim.ui_attach', function()
feed('version<CR><CR>v<Esc>')
n.assert_alive()
end)
+
+ it("preserved 'incsearch/command' screen state after :redraw from ext_cmdline", function()
+ exec_lua([[
+ vim.cmd.norm('ifoobar')
+ vim.cmd('1split cmdline')
+ local buf = vim.api.nvim_get_current_buf()
+ vim.cmd.wincmd('p')
+ vim.ui_attach(ns, { ext_cmdline = true }, function(event, ...)
+ if event == 'cmdline_show' then
+ local content = select(1, ...)
+ vim.api.nvim_buf_set_lines(buf, -2, -1, false, {content[1][2]})
+ vim.cmd('redraw')
+ end
+ return true
+ end)
+ ]])
+ -- Updates a cmdline window
+ feed(':cmdline')
+ screen:expect({
+ grid = [[
+ cmdline |
+ {5:cmdline [+] }|
+ fooba^r |
+ {6:[No Name] [+] }|
+ |
+ ]],
+ })
+ -- Does not clear 'incsearch' highlighting
+ feed('<Esc>/foo')
+ screen:expect({
+ grid = [[
+ foo |
+ {5:cmdline [+] }|
+ {5:foo}ba^r |
+ {6:[No Name] [+] }|
+ |
+ ]],
+ })
+ -- Shows new cmdline state during 'inccommand'
+ feed('<Esc>:%s/bar/baz')
+ screen:expect({
+ grid = [[
+ %s/bar/baz |
+ {5:cmdline [+] }|
+ foo{7:ba^z} |
+ {6:[No Name] [+] }|
+ |
+ ]],
+ })
+ end)
end)
describe('vim.ui_attach', function()