mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 00:22:41 +00:00
fix(api): avoid immediate TextChanged with nvim_create_buf (#25492)
This commit is contained in:
@@ -2869,6 +2869,18 @@ describe('API', function()
|
||||
eq(false, eval('g:fired'))
|
||||
end)
|
||||
|
||||
it('TextChanged and TextChangedI do not trigger without changes', function()
|
||||
local buf = meths.create_buf(true, false)
|
||||
command([[let g:changed = '']])
|
||||
meths.create_autocmd({'TextChanged', 'TextChangedI'}, {
|
||||
buffer = buf,
|
||||
command = 'let g:changed ..= mode()',
|
||||
})
|
||||
meths.set_current_buf(buf)
|
||||
feed('i')
|
||||
eq('', meths.get_var('changed'))
|
||||
end)
|
||||
|
||||
it('scratch-buffer', function()
|
||||
eq({id=2}, meths.create_buf(false, true))
|
||||
eq({id=3}, meths.create_buf(true, true))
|
||||
|
||||
Reference in New Issue
Block a user