diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-16 21:27:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-16 21:27:23 +0100 |
commit | da440d21a6b94d7f525fa7be9b1417c78dd9aa4c (patch) | |
tree | 646615551e8f62b82cfca1a1ef70fb2e3341d8b0 /runtime | |
parent | 286eacd3f6631e985089176fb1dff1bcf1a1d6b5 (diff) |
patch 7.4.1107v7.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.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 35a12df6e4..6edd3f5411 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -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. |