undo: reduce reliance on curbuf

This commit is contained in:
Thomas Vigouroux
2020-09-23 22:45:51 +02:00
parent 55a2c513aa
commit 763c852812
11 changed files with 217 additions and 187 deletions

View File

@@ -1078,10 +1078,11 @@ static void f_complete(typval_T *argvars, typval_T *rettv, FunPtr fptr)
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())
// 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(curbuf)) {
return;
}
if (argvars[1].v_type != VAR_LIST) {
EMSG(_(e_invarg));