mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 09:19:43 +10:00
fix(defaults): make terminal autoclose not block other events (#27581)
Problem: When terminal is autocloses, it blocks other events, like `BufEnter`. Solution: Use `nested = true`.
This commit is contained in:
committed by
GitHub
parent
0760d98680
commit
85cb0b0ddc
@@ -1232,3 +1232,22 @@ describe('stdpath()', function()
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('autocommands', function()
|
||||
it('closes terminal with default shell on success', function()
|
||||
api.nvim_set_option_value('shell', helpers.testprg('shell-test'), {})
|
||||
command('set shellcmdflag=EXIT shellredir= shellpipe= shellquote= shellxquote=')
|
||||
|
||||
-- Should not block other events
|
||||
command('let g:n=0')
|
||||
command('au BufEnter * let g:n = g:n + 1')
|
||||
|
||||
command('terminal')
|
||||
eq(eval('get(g:, "n", 0)'), 1)
|
||||
|
||||
helpers.retry(nil, 1000, function()
|
||||
neq(api.nvim_get_option_value('buftype', { buf = 0 }), 'terminal')
|
||||
eq(eval('get(g:, "n", 0)'), 2)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user