diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-12-25 13:06:00 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-01-13 10:39:32 +0100 |
commit | e5d9b15044d56acd48569b3ca7ac9dabdeaa750e (patch) | |
tree | 5ac3644a9c5af48c791504e06bec9dadf70fdb84 /test | |
parent | 3bcf8e5622f29a65564bf2f7672997432e183dfa (diff) | |
download | rneovim-e5d9b15044d56acd48569b3ca7ac9dabdeaa750e.tar.gz rneovim-e5d9b15044d56acd48569b3ca7ac9dabdeaa750e.tar.bz2 rneovim-e5d9b15044d56acd48569b3ca7ac9dabdeaa750e.zip |
fix(buffer_updates): correct buffer updates when splitting empty line
fixes #11591
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/buffer_updates_spec.lua | 10 | ||||
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index b0efcf0dab..8e43d28322 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -349,6 +349,16 @@ describe('API: buffer events:', function() expectn('nvim_buf_lines_event', { b, tick, 3, 4, {}, false }) end) + it('visual paste split empty line', function() + local b, tick = editoriginal(true, { 'abc', '{', 'def', '}' }) + command('normal! ggyyjjvi{p') + expectn('nvim_buf_lines_event', { b, tick + 1, 2, 3, { '' }, false }) + expectn('nvim_buf_lines_event', { b, tick + 2, 2, 3, { '}' }, false }) + expectn('nvim_buf_lines_event', { b, tick + 3, 3, 4, {}, false }) + expectn('nvim_buf_lines_event', { b, tick + 3, 2, 3, { '' }, false }) + expectn('nvim_buf_lines_event', { b, tick + 4, 3, 3, { 'abc', '}' }, false }) + end) + it('when lines are filtered', function() -- Test filtering lines with !cat local b, tick = editoriginal(true, { 'A', 'C', 'E', 'B', 'D', 'F' }) diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index 073ac40ef1..447c1ee345 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -1073,6 +1073,15 @@ describe('lua: nvim_buf_attach on_bytes', function() } end) + it('visual paste 2: splitting an empty line', function() + local check_events = setup_eventcheck(verify, { 'abc', '{', 'def', '}' }) + feed('ggyyjjvi{p') + check_events { + { 'test1', 'bytes', 1, 6, 2, 0, 6, 1, 0, 4, 0, 0, 0 }, + { 'test1', 'bytes', 1, 6, 2, 0, 6, 0, 0, 0, 2, 0, 5 }, + } + end) + it('nvim_buf_set_lines', function() local check_events = setup_eventcheck(verify, { 'AAA', 'BBB' }) |