From 7fbabbaa576cd3e1de303d6040b1c8444d5708a7 Mon Sep 17 00:00:00 2001 From: chentau Date: Mon, 22 Mar 2021 19:44:21 -0700 Subject: Extmarks: correct buffer events on blockwise paste --- test/functional/lua/buffer_updates_spec.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/functional/lua') diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index 7a6b5be8bc..ad686e0386 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -717,6 +717,26 @@ describe('lua: nvim_buf_attach on_bytes', function() command("bw!") end) + it("blockwise paste with uneven line lengths", function() + local check_events = setup_eventcheck(verify, {'aaaa', 'aaa', 'aaa'}) + + -- eq({}, meths.buf_get_lines(0, 0, -1, true)) + feed("gg0jj$d") + + check_events { + { "test1", "bytes", 1, 3, 0, 0, 0, 0, 4, 4, 0, 0, 0 }, + { "test1", "bytes", 1, 3, 1, 0, 1, 0, 3, 3, 0, 0, 0 }, + { "test1", "bytes", 1, 3, 2, 0, 2, 0, 3, 3, 0, 0, 0 }, + } + + feed("p") + check_events { + { "test1", "bytes", 1, 4, 0, 0, 0, 0, 0, 0, 0, 4, 4 }, + { "test1", "bytes", 1, 4, 1, 0, 5, 0, 0, 0, 0, 3, 3 }, + { "test1", "bytes", 1, 4, 2, 0, 9, 0, 0, 0, 0, 3, 3 }, + } + + end) teardown(function() os.remove "Xtest-reload" -- cgit