diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-11 14:48:10 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-11 14:48:10 +0200 |
commit | a8f71676a199b6ffccedf7388d4104431144b158 (patch) | |
tree | 12cf3bce9946a330af77c8b3eeedbae3a99770c5 | |
parent | f0e258cf8569b07153ed6beb1d31455e4de142f4 (diff) | |
download | rneovim-a8f71676a199b6ffccedf7388d4104431144b158.tar.gz rneovim-a8f71676a199b6ffccedf7388d4104431144b158.tar.bz2 rneovim-a8f71676a199b6ffccedf7388d4104431144b158.zip |
fix(bufupdates): avoid sending empty updates
-rw-r--r-- | src/nvim/buffer_updates.c | 3 | ||||
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index 79483380c9..4f56e5bf9e 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -288,7 +288,8 @@ void buf_updates_send_splice( int old_row, colnr_T old_col, bcount_t old_byte, int new_row, colnr_T new_col, bcount_t new_byte) { - if (!buf_updates_active(buf)) { + if (!buf_updates_active(buf) + || (old_byte == 0 && new_byte == 0)) { return; } diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index cbf1b2708e..5be47070a7 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -338,7 +338,6 @@ describe('lua: nvim_buf_attach on_bytes', function() } feed '<cr>' check_events { - { "test1", "bytes", 1, 4, 8, 0, 115, 0, 0, 0, 0, 0, 0 }; { "test1", "bytes", 1, 5, 7, 0, 114, 0, 0, 0, 1, 0, 1 }; } end) |