diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-17 23:34:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-17 23:34:28 +0200 |
commit | 6dc815530b7b127c5b5e0912783c3f2118cb184f (patch) | |
tree | 284d2d497a27ee53593a2e69385f6627de2befc9 /test/functional/lua/buffer_updates_spec.lua | |
parent | 2d9ae2166470b164bfce15333c85d00b93ff83f4 (diff) | |
download | rneovim-6dc815530b7b127c5b5e0912783c3f2118cb184f.tar.gz rneovim-6dc815530b7b127c5b5e0912783c3f2118cb184f.tar.bz2 rneovim-6dc815530b7b127c5b5e0912783c3f2118cb184f.zip |
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.
Diffstat (limited to 'test/functional/lua/buffer_updates_spec.lua')
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index faf63e7374..ac5d25bdab 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -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() |