forked from aniani/vim
patch 9.0.0379: cleaning up after writefile() is a hassle
Problem: Cleaning up after writefile() is a hassle. Solution: Add the 'D' flag to defer deleting the written file. Very useful in tests.
This commit is contained in:
@@ -833,6 +833,14 @@ compile_call(
|
||||
}
|
||||
}
|
||||
|
||||
if (STRCMP(name, "writefile") == 0 && argcount > 2)
|
||||
{
|
||||
// May have the "D" flag, reserve a variable for a deferred
|
||||
// function call.
|
||||
if (get_defer_var_idx(cctx) == 0)
|
||||
idx = -1;
|
||||
}
|
||||
|
||||
if (idx >= 0)
|
||||
res = generate_BCALL(cctx, idx, argcount, argcount_init == 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user