|
1 |
| -*eval.txt* For Vim version 8.2. Last change: 2020 Mar 26 |
| 1 | +*eval.txt* For Vim version 8.2. Last change: 2020 Apr 08 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -5149,10 +5149,11 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
5149 | 5149 | <
|
5150 | 5150 | *getcurpos()*
|
5151 | 5151 | getcurpos() Get the position of the cursor. This is like getpos('.'), but
|
5152 |
| - includes an extra item in the list: |
5153 |
| - [bufnum, lnum, col, off, curswant] ~ |
| 5152 | + includes an extra "curswant" item in the list: |
| 5153 | + [0, lnum, col, off, curswant] ~ |
5154 | 5154 | The "curswant" number is the preferred column when moving the
|
5155 | 5155 | cursor vertically. Also see |getpos()|.
|
| 5156 | + The first "bufnum" item is always zero. |
5156 | 5157 |
|
5157 | 5158 | This can be used to save and restore the cursor position: >
|
5158 | 5159 | let save_cursor = getcurpos()
|
@@ -8929,18 +8930,10 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()*
|
8929 | 8930 |
|
8930 | 8931 | Returns zero for success, -1 for failure.
|
8931 | 8932 |
|
8932 |
| - Examples: |
8933 |
| - Set current index of the tag stack to 4: > |
8934 |
| - call settagstack(1005, {'curidx' : 4}) |
8935 |
| -
|
8936 |
| -< Empty the tag stack of window 3: > |
| 8933 | + Examples (for more examples see |tagstack-examples||): |
| 8934 | + Empty the tag stack of window 3: > |
8937 | 8935 | call settagstack(3, {'items' : []})
|
8938 | 8936 |
|
8939 |
| -< Push a new item onto the tag stack: > |
8940 |
| - let pos = [bufnr('myfile.txt'), 10, 1, 0] |
8941 |
| - let newtag = [{'tagname' : 'mytag', 'from' : pos}] |
8942 |
| - call settagstack(2, {'items' : newtag}, 'a') |
8943 |
| -
|
8944 | 8937 | < Save and restore the tag stack: >
|
8945 | 8938 | let stack = gettagstack(1003)
|
8946 | 8939 | " do something else
|
@@ -9036,6 +9029,8 @@ simplify({filename}) *simplify()*
|
9036 | 9029 | directory. In order to resolve all the involved symbolic
|
9037 | 9030 | links before simplifying the path name, use |resolve()|.
|
9038 | 9031 |
|
| 9032 | + Can also be used as a |method|: > |
| 9033 | + GetName()->simplify() |
9039 | 9034 |
|
9040 | 9035 | sin({expr}) *sin()*
|
9041 | 9036 | Return the sine of {expr}, measured in radians, as a |Float|.
|
@@ -10888,6 +10883,7 @@ hpux HP-UX version of Vim.
|
10888 | 10883 | iconv Can use iconv() for conversion.
|
10889 | 10884 | insert_expand Compiled with support for CTRL-X expansion commands in
|
10890 | 10885 | Insert mode. (always true)
|
| 10886 | +job Compiled with support for |channel| and |job| |
10891 | 10887 | jumplist Compiled with |jumplist| support.
|
10892 | 10888 | keymap Compiled with 'keymap' support.
|
10893 | 10889 | lambda Compiled with |lambda| support.
|
@@ -11255,8 +11251,8 @@ It is allowed to define another function inside a function body.
|
11255 | 11251 | You can provide default values for positional named arguments. This makes
|
11256 | 11252 | them optional for function calls. When a positional argument is not
|
11257 | 11253 | specified at a call, the default expression is used to initialize it.
|
11258 |
| -This only works for functions declared with `:function`, not for lambda |
11259 |
| -expressions |expr-lambda|. |
| 11254 | +This only works for functions declared with `:function` or `:def`, not for |
| 11255 | +lambda expressions |expr-lambda|. |
11260 | 11256 |
|
11261 | 11257 | Example: >
|
11262 | 11258 | function Something(key, value = 10)
|
@@ -11294,9 +11290,10 @@ Example that does NOT work: >
|
11294 | 11290 | :function NoGood(first = a:second, second = 10)
|
11295 | 11291 | :endfunction
|
11296 | 11292 | <
|
11297 |
| -When not using "...", the number of arguments in a function call must be equal |
11298 |
| -to the number of mandatory named arguments. When using "...", the number of |
11299 |
| -arguments may be larger. |
| 11293 | +When not using "...", the number of arguments in a function call must be at |
| 11294 | +least equal to the number of mandatory named arguments. When using "...", the |
| 11295 | +number of arguments may be larger than the total of mandatory and optional |
| 11296 | +arguments. |
11300 | 11297 |
|
11301 | 11298 | *local-variables*
|
11302 | 11299 | Inside a function local variables can be used. These will disappear when the
|
@@ -11653,7 +11650,7 @@ This does NOT work: >
|
11653 | 11650 | Like above, but append/add/subtract the value for each
|
11654 | 11651 | |List| item.
|
11655 | 11652 |
|
11656 |
| -:let [{name}, ..., ; {lastname}] = {expr1} |
| 11653 | +:let [{name}, ..., ; {lastname}] = {expr1} *E452* |
11657 | 11654 | Like |:let-unpack| above, but the |List| may have more
|
11658 | 11655 | items than there are names. A list of the remaining
|
11659 | 11656 | items is assigned to {lastname}. If there are no
|
|
0 commit comments