mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0411: only created files can be cleaned up with one call
Problem: Only created files can be cleaned up with one call. Solution: Add flags to mkdir() to delete with a deferred function. Expand the writefile() name to a full path to handle changing directory.
This commit is contained in:
@@ -5649,6 +5649,21 @@ ex_defer_inner(
|
||||
return add_defer(name, argcount, argvars);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if currently inside a function call.
|
||||
* Give an error message and return FALSE when not.
|
||||
*/
|
||||
int
|
||||
can_add_defer(void)
|
||||
{
|
||||
if (!in_def_function() && get_current_funccal() == NULL)
|
||||
{
|
||||
semsg(_(e_str_not_inside_function), "defer");
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a deferred call for "name" with arguments "argvars[argcount]".
|
||||
* Consumes "argvars[]".
|
||||
|
Reference in New Issue
Block a user