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

@@ -2194,7 +2194,7 @@ static void cmdpreview_restore_state(CpInfo *cpinfo)
aco_save_T aco;
aucmd_prepbuf(&aco, buf);
// Undo invisibly. This also moves the cursor!
if (!u_undo_and_forget(count)) {
if (!u_undo_and_forget(count, false)) {
abort();
}
aucmd_restbuf(&aco);