summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 273ac41360..01610fe3bb 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -8252,6 +8252,12 @@ f_complete(argvars, rettv)
EMSG(_("E785: complete() can only be used in Insert mode"));
return;
}
+
+ /* Check for undo allowed here, because if something was already inserted
+ * the line was already saved for undo and this check isn't done. */
+ if (!undo_allowed())
+ return;
+
if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL)
{
EMSG(_(e_invarg));