aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r--src/nvim/eval/userfunc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 23b3c4e1b2..3b101454b5 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -23,7 +23,6 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
-#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
#include "nvim/gettext.h"
@@ -934,6 +933,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
int started_profiling = false;
bool did_save_redo = false;
save_redo_T save_redo;
+ char* saved_repeat_cmdline = NULL;
// If depth of calling is getting too high, don't execute the function
if (depth >= p_mfd) {
@@ -946,6 +946,9 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
// Save search patterns and redo buffer.
save_search_patterns();
if (!ins_compl_active()) {
+ if (repeat_cmdline) {
+ saved_repeat_cmdline = xstrdup(repeat_cmdline);
+ }
saveRedobuff(&save_redo);
did_save_redo = true;
}
@@ -1288,6 +1291,8 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
// restore search patterns and redo buffer
if (did_save_redo) {
restoreRedobuff(&save_redo);
+ xfree(repeat_cmdline);
+ repeat_cmdline = saved_repeat_cmdline;
}
restore_search_patterns();
}