0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 7.4.1107

Problem:    Vim can create a directory but not delete it.
Solution:   Add an argument to delete() to make it possible to delete a
            directory, also recursively.
This commit is contained in:
Bram Moolenaar
2016-01-16 21:27:23 +01:00
parent 286eacd3f6
commit da440d21a6
7 changed files with 133 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 15
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -919,6 +919,11 @@ just above, except that indexes out of range cause an error. Examples: >
Using expr8[expr1] or expr8[expr1a : expr1b] on a |Funcref| results in an
error.
Watch out for confusion between a namespace and a variable followed by a colon
for a sublist: >
mylist[n:] " uses variable n
mylist[s:] " uses namespace s:, error!
expr8.name entry in a |Dictionary| *expr-entry*
@@ -1794,7 +1799,7 @@ cursor( {lnum}, {col} [, {off}])
Number move cursor to {lnum}, {col}, {off}
cursor( {list}) Number move cursor to position in {list}
deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
delete( {fname}) Number delete file {fname}
delete( {fname} [, {flags}]) Number delete the file or directory {fname}
did_filetype() Number TRUE if FileType autocommand event used
diff_filler( {lnum}) Number diff filler lines about {lnum}
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
@@ -2748,10 +2753,19 @@ deepcopy({expr}[, {noref}]) *deepcopy()* *E698*
{noref} set to 1 will fail.
Also see |copy()|.
delete({fname}) *delete()*
Deletes the file by the name {fname}. The result is a Number,
which is 0 if the file was deleted successfully, and non-zero
when the deletion failed.
delete({fname} [, {flags}]) *delete()*
Without {flags} or with {flags} empty: Deletes the file by the
name {fname}.
When {flags} is "d": Deletes the directory by the name
{fname}. This fails when {fname} is not empty.
When {flags} is "rf": Deletes the directory by the name
{fname} and everything in it, recursively. Be careful!
The result is a Number, which is 0 if the delete operation was
successful and -1 when the deletion failed or partly failed.
Use |remove()| to delete an item from a |List|.
To delete a line from the buffer use |:delete|. Use |:exe|
when the line number is in a variable.