diff options
author | Jaehwang Jung <tomtomjhj@gmail.com> | 2023-03-11 16:52:46 +0900 |
---|---|---|
committer | Jaehwang Jung <tomtomjhj@gmail.com> | 2023-03-11 18:22:00 +0900 |
commit | 2748202e0eb28574cdc65dcb758adea89023271d (patch) | |
tree | 3e9a5a834bf280b3ecc1d29c56557c6f3f4a17d4 /test/functional/lua/buffer_updates_spec.lua | |
parent | 236c20795eb9f11e21e0719b735ea741711acc08 (diff) | |
download | rneovim-2748202e0eb28574cdc65dcb758adea89023271d.tar.gz rneovim-2748202e0eb28574cdc65dcb758adea89023271d.tar.bz2 rneovim-2748202e0eb28574cdc65dcb758adea89023271d.zip |
fix(diff): trigger on_bytes only once after diffget/diffput
Problem: The fix from b50ee4a8dc4306e4be78ac33fb74b21dc6be5538 may
adjust extmark twice, triggering on_bytes callback twice.
Solution: Don't let mark_adjust adjust extmark.
Diffstat (limited to 'test/functional/lua/buffer_updates_spec.lua')
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index b1b39501f7..2cd3123dcd 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -1171,6 +1171,25 @@ describe('lua: nvim_buf_attach on_bytes', function() } end) + it('works with :diffput and :diffget', function() + local check_events = setup_eventcheck(verify, {"AAA"}) + command('diffthis') + command('new') + command('diffthis') + meths.buf_set_lines(0, 0, -1, true, {"AAA", "BBB"}) + feed('G') + command('diffput') + check_events { + { "test1", "bytes", 1, 3, 1, 0, 4, 0, 0, 0, 1, 0, 4 }; + } + meths.buf_set_lines(0, 0, -1, true, {"AAA", "CCC"}) + feed('<C-w>pG') + command('diffget') + check_events { + { "test1", "bytes", 1, 4, 1, 0, 4, 1, 0, 4, 1, 0, 4 }; + } + end) + local function test_lockmarks(mode) local description = (mode ~= "") and mode or "(baseline)" it("test_lockmarks " .. description .. " %delete _", function() |