mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
buf_updates: fix updates for empty buffers (#12926)
On empty buffers, when editing the first line, the line is buffered, causing offset to be < 0. While the buffer is not actually empty, the buffered line has not been flushed (and should not be) yet, so the call is valid but an edge case.
This commit is contained in:
@@ -402,6 +402,15 @@ describe('lua: nvim_buf_attach on_bytes', function()
|
||||
{ "test1", "bytes", 1, 7, 1, 3, 14, 0, 0, 0, 1, 3, 4 };
|
||||
}
|
||||
end)
|
||||
|
||||
it('editing empty buffers', function()
|
||||
local check_events = setup_eventcheck(verify, {})
|
||||
|
||||
feed 'ia'
|
||||
check_events {
|
||||
{ "test1", "bytes", 1, 3, 0, 0, 0, 0, 0, 0, 0, 1, 1 };
|
||||
}
|
||||
end)
|
||||
end
|
||||
|
||||
describe('(with verify) handles', function()
|
||||
|
||||
Reference in New Issue
Block a user