From 237175cf20af5cac6d2e02560a65fd4590d2080c Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Mon, 17 May 2021 20:24:11 +0200 Subject: fix(bufupdate): send events when inserting with virtualedit Problem first raised https://github.com/nvim-treesitter/nvim-treesitter/issues/1304 --- test/functional/lua/buffer_updates_spec.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/functional/lua/buffer_updates_spec.lua') diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index 5bfab1d52d..54e10fabd6 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -936,6 +936,26 @@ describe('lua: nvim_buf_attach on_bytes', function() } end) + it("virtual edit", function () + local check_events = setup_eventcheck(verify, { "", " " }) + + meths.set_option("virtualedit", "all") + + feed [[iab]] + + check_events { + { "test1", "bytes", 1, 3, 0, 0, 0, 0, 0, 0, 0, 2, 2 }; + { "test1", "bytes", 1, 4, 0, 2, 2, 0, 0, 0, 0, 2, 2 }; + } + + feed [[jiab]] + + check_events { + { "test1", "bytes", 1, 5, 1, 0, 5, 0, 1, 1, 0, 8, 8 }; + { "test1", "bytes", 1, 6, 1, 5, 10, 0, 0, 0, 0, 2, 2 }; + } + end) + it("block visual paste", function() local check_events = setup_eventcheck(verify, {"AAA", "BBB", -- cgit