diff options
author | glepnir <glephunter@gmail.com> | 2023-09-11 19:46:15 +0800 |
---|---|---|
committer | glepnir <glephunter@gmail.com> | 2023-09-19 18:44:48 +0800 |
commit | 437ed3cee2d29a24d555a873d024cd851b953153 (patch) | |
tree | 15384181fdf4d3a708b38946abfa767137b560f5 /test/functional/ui/float_spec.lua | |
parent | 71530cc972576e6656431b6d000aec9b69a0997e (diff) | |
download | rneovim-437ed3cee2d29a24d555a873d024cd851b953153.tar.gz rneovim-437ed3cee2d29a24d555a873d024cd851b953153.tar.bz2 rneovim-437ed3cee2d29a24d555a873d024cd851b953153.zip |
fix(float): trigger winnew event when float window create
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r-- | test/functional/ui/float_spec.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index e37b3ccb5f..556859478e 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -103,6 +103,29 @@ describe('float window', function() assert_alive() end) + it('open with WinNew autocmd', function() + local res = exec_lua([[ + local triggerd = false + local buf = vim.api.nvim_create_buf(true, true) + vim.api.nvim_create_autocmd('WinNew', { + callback = function(opt) + if opt.buf == buf then + triggerd = true + end + end + }) + local opts = { + relative = "win", + row = 0, col = 0, + width = 1, height = 1, + noautocmd = false, + } + vim.api.nvim_open_win(buf, true, opts) + return triggerd + ]]) + eq(true, res) + end) + it('opened with correct height', function() local height = exec_lua([[ vim.go.winheight = 20 |