comparison runtime/doc/eval.txt @ 13329:424321d6eea7 v8.0.1539

patch 8.0.1539: no test for the popup menu positioning commit https://github.com/vim/vim/commit/6bb2cdfe604e51eec216cbe23bb6e8fb47810347 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 24 19:53:53 2018 +0100 patch 8.0.1539: no test for the popup menu positioning Problem: No test for the popup menu positioning. Solution: Add a screendump test for the popup menu.
author Christian Brabandt <cb@256bit.org>
date Sat, 24 Feb 2018 20:00:07 +0100
parents a88c5e12b860
children acd7eaa13d2b
comparison
equal deleted inserted replaced
13328:2c639a9a4def 13329:424321d6eea7
1 *eval.txt* For Vim version 8.0. Last change: 2018 Feb 18 1 *eval.txt* For Vim version 8.0. Last change: 2018 Feb 24
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
1244 :echo F() 1244 :echo F()
1245 < error function 1245 < error function
1246 *closure* 1246 *closure*
1247 Lambda expressions can access outer scope variables and arguments. This is 1247 Lambda expressions can access outer scope variables and arguments. This is
1248 often called a closure. Example where "i" and "a:arg" are used in a lambda 1248 often called a closure. Example where "i" and "a:arg" are used in a lambda
1249 while they exist in the function scope. They remain valid even after the 1249 while they already exist in the function scope. They remain valid even after
1250 function returns: > 1250 the function returns: >
1251 :function Foo(arg) 1251 :function Foo(arg)
1252 : let i = 3 1252 : let i = 3
1253 : return {x -> x + i - a:arg} 1253 : return {x -> x + i - a:arg}
1254 :endfunction 1254 :endfunction
1255 :let Bar = Foo(4) 1255 :let Bar = Foo(4)
1256 :echo Bar(6) 1256 :echo Bar(6)
1257 < 5 1257 < 5
1258 1258
1259 See also |:func-closure|. Lambda and closure support can be checked with: > 1259 Note that the variables must exist in the outer scope before the lamba is
1260 defined for this to work. See also |:func-closure|.
1261
1262 Lambda and closure support can be checked with: >
1260 if has('lambda') 1263 if has('lambda')
1261 1264
1262 Examples for using a lambda expression with |sort()|, |map()| and |filter()|: > 1265 Examples for using a lambda expression with |sort()|, |map()| and |filter()|: >
1263 :echo map([1, 2, 3], {idx, val -> val + 1}) 1266 :echo map([1, 2, 3], {idx, val -> val + 1})
1264 < [2, 3, 4] > 1267 < [2, 3, 4] >
2414 tempname() String name for a temporary file 2417 tempname() String name for a temporary file
2415 term_dumpdiff({filename}, {filename} [, {options}]) 2418 term_dumpdiff({filename}, {filename} [, {options}])
2416 Number display difference between two dumps 2419 Number display difference between two dumps
2417 term_dumpload({filename} [, {options}]) 2420 term_dumpload({filename} [, {options}])
2418 Number displaying a screen dump 2421 Number displaying a screen dump
2419 term_dumpwrite({buf}, {filename} [, {max-height} [, {max-width}]]) 2422 term_dumpwrite({buf}, {filename} [, {options}])
2420 none dump terminal window contents 2423 none dump terminal window contents
2421 term_getaltscreen({buf}) Number get the alternate screen flag 2424 term_getaltscreen({buf}) Number get the alternate screen flag
2422 term_getattr({attr}, {what}) Number get the value of attribute {what} 2425 term_getattr({attr}, {what}) Number get the value of attribute {what}
2423 term_getcursor({buf}) List get the cursor position of a terminal 2426 term_getcursor({buf}) List get the cursor position of a terminal
2424 term_getjob({buf}) Job get the job associated with a terminal 2427 term_getjob({buf}) Job get the job associated with a terminal
6584 The result must be a String or a |List|. A |List| is turned 6587 The result must be a String or a |List|. A |List| is turned
6585 into a String by joining the items with a line break in 6588 into a String by joining the items with a line break in
6586 between (not at the end), like with join(expr, "\n"). 6589 between (not at the end), like with join(expr, "\n").
6587 If {idvar} is present and not empty, it is taken as the name 6590 If {idvar} is present and not empty, it is taken as the name
6588 of a variable and a {serverid} for later use with 6591 of a variable and a {serverid} for later use with
6589 remote_read() is stored there. 6592 |remote_read()| is stored there.
6590 If {timeout} is given the read times out after this many 6593 If {timeout} is given the read times out after this many
6591 seconds. Otherwise a timeout of 600 seconds is used. 6594 seconds. Otherwise a timeout of 600 seconds is used.
6592 See also |clientserver| |RemoteReply|. 6595 See also |clientserver| |RemoteReply|.
6593 This function is not available in the |sandbox|. 6596 This function is not available in the |sandbox|.
6594 {only available when compiled with the |+clientserver| feature} 6597 {only available when compiled with the |+clientserver| feature}
8188 Also see |terminal-diff|. 8191 Also see |terminal-diff|.
8189 8192
8190 {options} are not implemented yet. 8193 {options} are not implemented yet.
8191 8194
8192 *term_dumpwrite()* 8195 *term_dumpwrite()*
8193 term_dumpwrite({buf}, {filename} [, {max-height} [, {max-width}]]) 8196 term_dumpwrite({buf}, {filename} [, {options}])
8194 Dump the contents of the terminal screen of {buf} in the file 8197 Dump the contents of the terminal screen of {buf} in the file
8195 {filename}. This uses a format that can be used with 8198 {filename}. This uses a format that can be used with
8196 |term_dumpread()| and |term_dumpdiff()|. 8199 |term_dumpread()| and |term_dumpdiff()|.
8197 If {filename} already exists an error is given. *E953* 8200 If {filename} already exists an error is given. *E953*
8198 Also see |terminal-diff|. 8201 Also see |terminal-diff|.
8202
8203 {options} is a dictionary with these optional entries:
8204 "rows" maximum number of rows to dump
8205 "columns" maximum number of columns to dump
8199 8206
8200 term_getaltscreen({buf}) *term_getaltscreen()* 8207 term_getaltscreen({buf}) *term_getaltscreen()*
8201 Returns 1 if the terminal of {buf} is using the alternate 8208 Returns 1 if the terminal of {buf} is using the alternate
8202 screen. 8209 screen.
8203 {buf} is used as with |term_getsize()|. 8210 {buf} is used as with |term_getsize()|.
9164 ttyin input is a terminal (tty) 9171 ttyin input is a terminal (tty)
9165 ttyout output is a terminal (tty) 9172 ttyout output is a terminal (tty)
9166 unix Unix version of Vim. *+unix* 9173 unix Unix version of Vim. *+unix*
9167 unnamedplus Compiled with support for "unnamedplus" in 'clipboard' 9174 unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
9168 user_commands User-defined commands. 9175 user_commands User-defined commands.
9176 vcon Win32: Virtual console support is working, can use 256
9177 and 24 bit colors.
9169 vertsplit Compiled with vertically split windows |:vsplit|. 9178 vertsplit Compiled with vertically split windows |:vsplit|.
9170 vim_starting True while initial source'ing takes place. |startup| 9179 vim_starting True while initial source'ing takes place. |startup|
9171 *vim_starting* 9180 *vim_starting*
9172 viminfo Compiled with viminfo support. 9181 viminfo Compiled with viminfo support.
9173 virtualedit Compiled with 'virtualedit' option. 9182 virtualedit Compiled with 'virtualedit' option.