mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
fix(cmd): :update writes new file buffers only for real files #35939
Problem: :update should write new file buffers, but previous fix affected special buffer types (acwrite, nofile, etc.). Solution: Add bt_nofilename() check to only write new files for buffers representing real filesystem paths.
This commit is contained in:
@@ -258,4 +258,15 @@ describe(':update', function()
|
||||
eq(1, eval('g:write_pre'))
|
||||
eq(1, eval('g:write_post'))
|
||||
end)
|
||||
|
||||
it('does not write acwrite buffer when unchanged', function()
|
||||
command('file remote://test')
|
||||
command('setlocal buftype=acwrite')
|
||||
command('let g:triggered = 0 | autocmd BufWriteCmd remote://* let g:triggered = 1')
|
||||
command('update')
|
||||
eq(0, eval('g:triggered'))
|
||||
command('call setline(1, ["hello"])')
|
||||
command('update')
|
||||
eq(1, eval('g:triggered'))
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user