mirror of
https://github.com/neovim/neovim.git
synced 2026-04-28 02:04:10 +00:00
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()).
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user