diff options
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r-- | runtime/doc/builtin.txt | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index f858440a9..aaf4e3b5e 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 8.2. Last change: 2022 Jan 22 +*builtin.txt* For Vim version 8.2. Last change: 2022 Jan 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2086,6 +2086,22 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined, For checking if a file exists use |filereadable()|. The {expr} argument is a string, which contains one of these: + varname internal variable (see + dict.key |internal-variables|). Also works + list[i] for |curly-braces-names|, |Dictionary| + import.Func entries, |List| items, imported + items,etc. + Does not work for local variables in a + compiled `:def` function. + Beware that evaluating an index may + cause an error message for an invalid + expression. E.g.: > + :let l = [1, 2, 3] + :echo exists("l[5]") +< 0 > + :echo exists("l[xx]") +< E121: Undefined variable: xx + 0 &option-name Vim option (only checks if it exists, not if it really works) +option-name Vim option that works. @@ -2100,21 +2116,6 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined, ?funcname built-in function that could be implemented; to be used to check if "funcname" is valid - varname internal variable (see - |internal-variables|). Also works - for |curly-braces-names|, |Dictionary| - entries, |List| items, etc. - Does not work for local variables in a - compiled `:def` function. - Beware that evaluating an index may - cause an error message for an invalid - expression. E.g.: > - :let l = [1, 2, 3] - :echo exists("l[5]") -< 0 > - :echo exists("l[xx]") -< E121: Undefined variable: xx - 0 :cmdname Ex command: built-in command, user command or command modifier |:command|. Returns: @@ -2539,7 +2540,7 @@ flatten({list} [, {maxdepth}]) *flatten()* The {list} is changed in place, use |flattennew()| if you do not want that. In Vim9 script flatten() cannot be used, you must always use - |flattennew()|. + |flattennew()|. *E1158* *E900* {maxdepth} means how deep in nested lists changes are made. {list} is not modified when {maxdepth} is 0. @@ -6540,7 +6541,7 @@ reduce({object}, {func} [, {initial}]) *reduce()* *E998* {func} is called for every item in {object}, which can be a |String|, |List| or a |Blob|. {func} is called with two arguments: the result so far and current item. After - processing all items the result is returned. + processing all items the result is returned. *E1132* {initial} is the initial result. When omitted, the first item in {object} is used and {func} is first called for the second @@ -7399,7 +7400,7 @@ setcellwidths({list}) *setcellwidths()* setcellwidths([[0xad, 0xad, 1], \ [0x2194, 0x2199, 2]]) -< *E1109* *E1110* *E1111* *E1112* *E1113* +< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114* The {list} argument is a list of lists with each three numbers. These three numbers are [low, high, width]. "low" and "high" can be the same, in which case this refers to one |