diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-05-07 18:35:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-05-07 18:35:30 +0200 |
commit | 1b1063af58b015b7827168f8fa2631efb60c252b (patch) | |
tree | ecebaed1979aee36aa61e9a7ea1bebdb597be0d6 /runtime | |
parent | 3ec7f4e4025c5a78ccd312f8516ac0740aa65dfe (diff) |
updated for version 7.4.279v7.4.279
Problem: globpath() returns a string, making it difficult to get a list of
matches. (Greg Novack)
Solution: Add an optional argument like with glob(). (Adnan Zafar)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index a3dd518ecc..3957508207 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1832,7 +1832,7 @@ getwinvar( {nr}, {varname} [, {def}]) any variable {varname} in window {nr} glob( {expr} [, {nosuf} [, {list}]]) any expand file wildcards in {expr} -globpath( {path}, {expr} [, {flag}]) +globpath( {path}, {expr} [, {nosuf} [, {list}]]) String do glob({expr}) for all dirs in {path} has( {feature}) Number TRUE if feature {feature} supported has_key( {dict}, {key}) Number TRUE if {dict} has entry {key} @@ -3571,11 +3571,12 @@ glob({expr} [, {nosuf} [, {list}]]) *glob()* See |expand()| for expanding special Vim variables. See |system()| for getting the raw output of an external command. -globpath({path}, {expr} [, {flag}]) *globpath()* +globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()* Perform glob() on all directories in {path} and concatenate the results. Example: > :echo globpath(&rtp, "syntax/c.vim") -< {path} is a comma-separated list of directory names. Each +< + {path} is a comma-separated list of directory names. Each directory name is prepended to {expr} and expanded like with |glob()|. A path separator is inserted when needed. To add a comma inside a directory name escape it with a @@ -3583,11 +3584,19 @@ globpath({path}, {expr} [, {flag}]) *globpath()* trailing backslash, remove it if you put a comma after it. If the expansion fails for one of the directories, there is no error message. - Unless the optional {flag} argument is given and is non-zero, + + Unless the optional {nosuf} argument is given and is non-zero, the 'suffixes' and 'wildignore' options apply: Names matching one of the patterns in 'wildignore' will be skipped and 'suffixes' affect the ordering of matches. + When {list} is present and it is non-zero the result is a List + with all matching files. The advantage of using a List is, you + also get filenames containing newlines correctly. Otherwise + the result is a String and when there are several matches, + they are separated by <NL> characters. Example: > + :echo globpath(&rtp, "syntax/c.vim", 0, 1) +< The "**" item can be used to search in a directory tree. For example, to find all "README.txt" files in the directories in 'runtimepath' and below: > |