diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-09-26 07:15:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 07:15:07 +0800 |
commit | ac66f5af06ac1f306b0ddb366ba81093508546c4 (patch) | |
tree | 26662b9ac82d8606123d782c9c07b1aeca67cd0c /src/nvim/undo.c | |
parent | a6c9764edaa349f5f268e5e3bf8b940e137fb5c4 (diff) | |
download | rneovim-ac66f5af06ac1f306b0ddb366ba81093508546c4.tar.gz rneovim-ac66f5af06ac1f306b0ddb366ba81093508546c4.tar.bz2 rneovim-ac66f5af06ac1f306b0ddb366ba81093508546c4.zip |
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.
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r-- | src/nvim/undo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c index d67863f84f..1a9066d7f1 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -1771,16 +1771,16 @@ void u_redo(int count) /// Undo and remove the branch from the undo tree. /// Also moves the cursor (as a "normal" undo would). -bool u_undo_and_forget(int count) +/// +/// @param do_buf_event If `true`, send the changedtick with the buffer updates +bool u_undo_and_forget(int count, bool do_buf_event) { if (curbuf->b_u_synced == false) { u_sync(true); count = 1; } undo_undoes = true; - u_doit(count, true, - // Don't send nvim_buf_lines_event for u_undo_and_forget(). - false); + u_doit(count, true, do_buf_event); if (curbuf->b_u_curhead == NULL) { // nothing was undone. |