fix(bufupdates): avoid sending empty updates

This commit is contained in:
Thomas Vigouroux
2020-09-11 14:48:10 +02:00
parent f0e258cf85
commit a8f71676a1
2 changed files with 2 additions and 2 deletions

View File

@@ -288,7 +288,8 @@ void buf_updates_send_splice(
int old_row, colnr_T old_col, bcount_t old_byte, int old_row, colnr_T old_col, bcount_t old_byte,
int new_row, colnr_T new_col, bcount_t new_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; return;
} }

View File

@@ -338,7 +338,6 @@ describe('lua: nvim_buf_attach on_bytes', function()
} }
feed '<cr>' feed '<cr>'
check_events { 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 }; { "test1", "bytes", 1, 5, 7, 0, 114, 0, 0, 0, 1, 0, 1 };
} }
end) end)