diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-05-27 22:10:42 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-06-01 03:05:04 +0100 |
commit | 802f8429d5d908457658e4b9859d8ed110bc0247 (patch) | |
tree | 7436cfb300621c512d8580ca07e3cb591837831d /test/functional/api/window_spec.lua | |
parent | 27c616d688c73c406726c949a3b664f52d4e4f04 (diff) | |
download | rneovim-802f8429d5d908457658e4b9859d8ed110bc0247.tar.gz rneovim-802f8429d5d908457658e4b9859d8ed110bc0247.tar.bz2 rneovim-802f8429d5d908457658e4b9859d8ed110bc0247.zip |
api(nvim_open_win): add "noautocmd" option
This option, when set, stops nvim_open_win() from potentially firing
buffer-related autocmd events
(BufEnter, BufLeave and BufWinEnter in the case of nvim_open_win()).
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r-- | test/functional/api/window_spec.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index ceeb84cec9..a57826f7e7 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -387,4 +387,18 @@ describe('API/win', function() eq({oldbuf}, meths.list_bufs()) end) end) + + describe('open_win', function() + it('noautocmd option works', function() + command('autocmd BufEnter,BufLeave,BufWinEnter * let g:fired = 1') + meths.open_win(meths.create_buf(true, true), true, { + relative='win', row=3, col=3, width=12, height=3, noautocmd=true + }) + eq(0, funcs.exists('g:fired')) + meths.open_win(meths.create_buf(true, true), true, { + relative='win', row=3, col=3, width=12, height=3 + }) + eq(1, funcs.exists('g:fired')) + end) + end) end) |