fix!: make :undo! notify buffer update callbacks (#20344)

When :undo! was introduced to Nvim the implementation of 'inccommand'
preview callback hasn't been fully decided yet, so not notifying buffer
update callbacks made sense for 'inccommand' preview callback in case it
needs to undo the changes itself.
Now it turns out that the undo-and-forget is done automatically for
'inccommand', so it doesn't make sense for :undo! to avoid notifying
buffer update callbacks anymore.
This commit is contained in:
zeertzjq
2022-09-26 07:15:07 +08:00
committed by GitHub
parent a6c9764eda
commit ac66f5af06
4 changed files with 25 additions and 7 deletions

View File

@@ -118,6 +118,24 @@ describe('lua buffer event callbacks: on_lines', function()
}
tick = tick + 1
tick = tick + 1
command('redo')
check_events {
{ "test1", "lines", 1, tick, 3, 5, 4, 32 };
{ "test2", "lines", 1, tick, 3, 5, 4, 32 };
{ "test2", "changedtick", 1, tick+1 };
}
tick = tick + 1
tick = tick + 1
command('undo!')
check_events {
{ "test1", "lines", 1, tick, 3, 4, 5, 13 };
{ "test2", "lines", 1, tick, 3, 4, 5, 13 };
{ "test2", "changedtick", 1, tick+1 };
}
tick = tick + 1
-- simulate next callback returning true
exec_lua("test_unreg = 'test1'")