diff options
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 752e368925..1a5268faf3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -69,7 +69,7 @@ To force conversion from String to Number, add zero to it: > To avoid a leading zero to cause octal conversion, or for using a different base, use |str2nr()|. - *TRUE* *FALSE* + *TRUE* *FALSE* *Boolean* For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE. You can also use |v:false| and |v:true|. When TRUE is returned from a function it is the Number one, FALSE is the number zero. @@ -92,7 +92,8 @@ Note that " " and "0" are also non-empty strings, thus considered to be TRUE. A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE. *E745* *E728* *E703* *E729* *E730* *E731* -List, Dictionary and Funcref types are not automatically converted. +|List|, |Dictionary|, |Funcref|, and |Blob| types are not automatically +converted. *E805* *E806* *E808* When mixing Number and Float the Number is converted to Float. Otherwise @@ -147,10 +148,10 @@ function() or funcref(). When calling the function the Dictionary and/or arguments will be passed to the function. Example: > let Cb = function('Callback', ['foo'], myDict) - call Cb() + call Cb('bar') This will invoke the function as if using: > - call myDict.Callback('foo') + call myDict.Callback('foo', 'bar') Note that binding a function to a Dictionary also happens when the function is a member of the Dictionary: > @@ -482,7 +483,7 @@ To loop over the values use the |values()| function: > :endfor If you want both the key and the value use the |items()| function. It returns -a List in which each item is a List with two items, the key and the value: > +a List in which each item is a List with two items, the key and the value: > :for [key, value] in items(mydict) : echo key . ': ' . value :endfor @@ -1408,7 +1409,9 @@ Note that this means that filetype plugins don't get a different set of script variables for each buffer. Use local buffer variables instead |b:var|. -Predefined Vim variables: *vim-variable* *v:var* *v:* +PREDEFINED VIM VARIABLES *vim-variable* *v:var* *v:* + *E963* +Some variables can be set by the user, but the type cannot be changed. *v:beval_col* *beval_col-variable* v:beval_col The number of the column, over which the mouse pointer is. @@ -4696,7 +4699,7 @@ gettagstack([{nr}]) *gettagstack()* getwinpos([{timeout}]) *getwinpos()* The result is a list with two numbers, the result of - getwinposx() and getwinposy() combined: + getwinposx() and getwinposy() combined: [x-pos, y-pos] {timeout} can be used to specify how long to wait in msec for a response from the terminal. When omitted 100 msec is used. @@ -5417,6 +5420,7 @@ len({expr}) The result is a Number, which is the length of the argument. used, as with |strlen()|. When {expr} is a |List| the number of items in the |List| is returned. + When {expr} is a |Blob| the number of bytes is returned. When {expr} is a |Dictionary| the number of entries in the |Dictionary| is returned. Otherwise an error is given. @@ -5501,13 +5505,6 @@ line({expr}) The result is a Number, which is the line number of the file line(".") line number of the cursor line("'t") line number of mark t line("'" . marker) line number of mark marker -< *last-position-jump* - This autocommand jumps to the last known position in a file - just after opening it, if the '" mark is set: > - :au BufReadPost * - \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' - \ | exe "normal! g`\"" - \ | endif line2byte({lnum}) *line2byte()* Return the byte count from the start of the buffer for line @@ -7514,9 +7511,9 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()* list of signs placed in that buffer is returned. For the use of {expr}, see |bufname()|. The optional {dict} can contain the following entries: - group select only signs in this group - id select sign with this identifier - lnum select signs placed in this line. For the use + group select only signs in this group + id select sign with this identifier + lnum select signs placed in this line. For the use of {lnum}, see |line()|. If {group} is '*', then signs in all the groups including the global group are returned. If {group} is not supplied or is an @@ -7557,11 +7554,11 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()* echo sign_getplaced("eval.c", {'lnum' : 10}) " Get sign with identifier 10 placed in a.py - echo sign_getplaced("a.py", {'id' : 10'}) + echo sign_getplaced("a.py", {'id' : 10}) " Get sign with id 20 in group 'g1' placed in a.py echo sign_getplaced("a.py", {'group' : 'g1', - \ 'id' : 20'}) + \ 'id' : 20}) " Get a List of all the placed signs echo sign_getplaced() @@ -7646,7 +7643,7 @@ sign_undefine([{name}]) *sign_undefine()* < sign_unplace({group} [, {dict}]) *sign_unplace()* Remove a previously placed sign in one or more buffers. This - is similar to the |:sign-unplace()| command. + is similar to the |:sign-unplace| command. {group} is the sign group name. To use the global sign group, use an empty string. If {group} is set to '*', then all the @@ -7936,7 +7933,8 @@ str2float({expr}) *str2float()* as when using a floating point number in an expression, see |floating-point-format|. But it's a bit more permissive. E.g., "1e40" is accepted, while in an expression you need to - write "1.0e40". + write "1.0e40". The hexadecimal form "0x123" is also + accepted, but not others, like binary or octal. Text after the number is silently ignored. The decimal point is always '.', no matter what the locale is set to. A comma ends the number: "12,345.67" is converted to @@ -8819,7 +8817,7 @@ win_getid([{win} [, {tab}]]) *win_getid()* Get the |window-ID| for the specified window. When {win} is missing use the current window. With {win} this is the window number. The top window has - number 1. Use `win_getid(winnr())` for the current window. + number 1. Without {tab} use the current tab, otherwise the tab with number {tab}. The first tab has number one. Return zero if the window cannot be found. |