vim-patch:8.0.0548: saving the redo buffer only works one time (#8629)

Problem:    Saving the redo buffer only works one time, resulting in the "."
            command not working well for a function call inside another
            function call. (Ingo Karkat)
Solution:   Save the redo buffer at every user function call. (closes vim/vim#1619)
d4863aa99e
This commit is contained in:
KunMing Xie
2018-06-25 04:16:57 +08:00
committed by Justin M. Keyes
parent 83be7cec98
commit 38fb835854
5 changed files with 62 additions and 38 deletions

View File

@@ -6696,6 +6696,7 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
static int filechangeshell_busy = FALSE;
proftime_T wait_time;
bool did_save_redobuff = false;
save_redo_T save_redo;
// Quickly return if there are no autocommands for this event or
// autocommands are blocked.
@@ -6876,7 +6877,7 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
if (!autocmd_busy) {
save_search_patterns();
if (!ins_compl_active()) {
saveRedobuff();
saveRedobuff(&save_redo);
did_save_redobuff = true;
}
did_filetype = keep_filetype;
@@ -6965,7 +6966,7 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
if (!autocmd_busy) {
restore_search_patterns();
if (did_save_redobuff) {
restoreRedobuff();
restoreRedobuff(&save_redo);
}
did_filetype = FALSE;
while (au_pending_free_buf != NULL) {