diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-10-07 20:52:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 20:52:10 +0200 |
commit | 2d206d5ab2725791e9f2ce40df3133aed7c48a70 (patch) | |
tree | 6aa47e2ae0966e6304251b343e495e9028a7d525 /test/functional/lua/buffer_updates_spec.lua | |
parent | fe608750a9473ad859e31644fad5a8deae518f2a (diff) | |
parent | 54b2c6800e9809b749381890da0f98f63f5fe53b (diff) | |
download | rneovim-2d206d5ab2725791e9f2ce40df3133aed7c48a70.tar.gz rneovim-2d206d5ab2725791e9f2ce40df3133aed7c48a70.tar.bz2 rneovim-2d206d5ab2725791e9f2ce40df3133aed7c48a70.zip |
Merge pull request #15946 from bfredl/issue-12861
fix(buffer_updates): make lockmarks not affect extmarks and buffer updates
Diffstat (limited to 'test/functional/lua/buffer_updates_spec.lua')
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index 42b3d86eb0..83ed7394b0 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -1088,6 +1088,48 @@ describe('lua: nvim_buf_attach on_bytes', function() } end) + local function test_lockmarks(mode) + local description = (mode ~= "") and mode or "(baseline)" + it("test_lockmarks " .. description .. " %delete _", function() + local check_events = setup_eventcheck(verify, {"AAA", "BBB", "CCC"}) + + command(mode .. " %delete _") + check_events { + { "test1", "bytes", 1, 3, 0, 0, 0, 3, 0, 12, 1, 0, 1 }; + } + end) + + it("test_lockmarks " .. description .. " append()", function() + local check_events = setup_eventcheck(verify) + + command(mode .. " call append(0, 'CCC')") + check_events { + { "test1", "bytes", 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 4 }; + } + + command(mode .. " call append(1, 'BBBB')") + check_events { + { "test1", "bytes", 1, 3, 1, 0, 4, 0, 0, 0, 1, 0, 5 }; + } + + command(mode .. " call append(2, '')") + check_events { + { "test1", "bytes", 1, 4, 2, 0, 9, 0, 0, 0, 1, 0, 1 }; + } + + command(mode .. " $delete _") + check_events { + { "test1", "bytes", 1, 5, 3, 0, 10, 1, 0, 1, 0, 0, 0 }; + } + + eq("CCC|BBBB|", table.concat(meths.buf_get_lines(0, 0, -1, true), "|")) + end) + end + + -- check that behavior is identical with and without "lockmarks" + test_lockmarks "" + test_lockmarks "lockmarks" + teardown(function() os.remove "Xtest-reload" os.remove "Xtest-undofile" |