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

@@ -21174,6 +21174,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars,
proftime_T wait_start;
proftime_T call_start;
bool did_save_redo = false;
save_redo_T save_redo;
/* If depth of calling is getting too high, don't execute the function */
if (depth >= p_mfd) {
@@ -21186,7 +21187,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars,
// Save search patterns and redo buffer.
save_search_patterns();
if (!ins_compl_active()) {
saveRedobuff();
saveRedobuff(&save_redo);
did_save_redo = true;
}
++fp->uf_calls;
@@ -21501,7 +21502,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars,
}
// restore search patterns and redo buffer
if (did_save_redo) {
restoreRedobuff();
restoreRedobuff(&save_redo);
}
restore_search_patterns();
}