aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/eval.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r--runtime/doc/eval.txt32
1 files changed, 13 insertions, 19 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 8558493520..c14af9001c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4446,10 +4446,11 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
*getcurpos()*
getcurpos() Get the position of the cursor. This is like getpos('.'), but
- includes an extra item in the list:
- [bufnum, lnum, col, off, curswant] ~
- The "curswant" number is the preferred column when moving the
+ includes an extra "curswant" in the list:
+ [0, lnum, col, off, curswant] ~
+ The "curswant" number is the preferred column when moving the
cursor vertically. Also see |getpos()|.
+ The first "bufnum" item is always zero.
This can be used to save and restore the cursor position: >
let save_cursor = getcurpos()
@@ -7790,18 +7791,10 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()*
Returns zero for success, -1 for failure.
- Examples:
- Set current index of the tag stack to 4: >
- call settagstack(1005, {'curidx' : 4})
-
-< Empty the tag stack of window 3: >
+ Examples (for more examples see |tagstack-examples||):
+ Empty the tag stack of window 3: >
call settagstack(3, {'items' : []})
-< Push a new item onto the tag stack: >
- let pos = [bufnr('myfile.txt'), 10, 1, 0]
- let newtag = [{'tagname' : 'mytag', 'from' : pos}]
- call settagstack(2, {'items' : newtag}, 'a')
-
< Save and restore the tag stack: >
let stack = gettagstack(1003)
" do something else
@@ -9581,8 +9574,8 @@ It is allowed to define another function inside a function body.
You can provide default values for positional named arguments. This makes
them optional for function calls. When a positional argument is not
specified at a call, the default expression is used to initialize it.
-This only works for functions declared with |function|, not for lambda
-expressions |expr-lambda|.
+This only works for functions declared with |function|, not for
+lambda expressions |expr-lambda|.
Example: >
function Something(key, value = 10)
@@ -9611,9 +9604,10 @@ Example that does NOT work: >
:function NoGood(first = a:second, second = 10)
:endfunction
<
-When not using "...", the number of arguments in a function call must be equal
-to the number of mandatory named arguments. When using "...", the number of
-arguments may be larger.
+When not using "...", the number of arguments in a function call must be at
+least equal to the number of mandatory named arguments. When using "...", the
+number of arguments may be larger than the total of mandatory and optional
+arguments.
*local-variables*
Inside a function local variables can be used. These will disappear when the
@@ -9943,7 +9937,7 @@ This does NOT work: >
Like above, but append/add/subtract the value for each
|List| item.
-:let [{name}, ..., ; {lastname}] = {expr1}
+:let [{name}, ..., ; {lastname}] = {expr1} *E452*
Like |:let-unpack| above, but the |List| may have more
items than there are names. A list of the remaining
items is assigned to {lastname}. If there are no