comparison runtime/doc/eval.txt @ 20552:74e3316c1d5a

Update runtime files Commit: https://github.com/vim/vim/commit/388a5d4f20b4b64341d1604aa238cab85827b892 Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 26 21:20:45 2020 +0200 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Tue, 26 May 2020 21:30:04 +0200
parents 729853a754ea
children 89b0f161e6a6
comparison
equal deleted inserted replaced
20551:f1b23a9643fe 20552:74e3316c1d5a
1 *eval.txt* For Vim version 8.2. Last change: 2020 Apr 19 1 *eval.txt* For Vim version 8.2. Last change: 2020 May 25
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
582 adict. 582 adict.
583 583
584 Weeding out entries from a Dictionary can be done with |filter()|: > 584 Weeding out entries from a Dictionary can be done with |filter()|: >
585 :call filter(dict, 'v:val =~ "x"') 585 :call filter(dict, 'v:val =~ "x"')
586 This removes all entries from "dict" with a value not matching 'x'. 586 This removes all entries from "dict" with a value not matching 'x'.
587 This can also be used to remove all entries: >
588 call filter(dict, 0)
587 589
588 590
589 Dictionary function ~ 591 Dictionary function ~
590 *Dictionary-function* *self* *E725* *E862* 592 *Dictionary-function* *self* *E725* *E862*
591 When a function is defined with the "dict" attribute it can be used in a 593 When a function is defined with the "dict" attribute it can be used in a
1483 :endfunction 1485 :endfunction
1484 :let Bar = Foo(4) 1486 :let Bar = Foo(4)
1485 :echo Bar(6) 1487 :echo Bar(6)
1486 < 5 1488 < 5
1487 1489
1488 Note that the variables must exist in the outer scope before the lamba is 1490 Note that the variables must exist in the outer scope before the lambda is
1489 defined for this to work. See also |:func-closure|. 1491 defined for this to work. See also |:func-closure|.
1490 1492
1491 Lambda and closure support can be checked with: > 1493 Lambda and closure support can be checked with: >
1492 if has('lambda') 1494 if has('lambda')
1493 1495
2914 win_screenpos({nr}) List get screen position of window {nr} 2916 win_screenpos({nr}) List get screen position of window {nr}
2915 win_splitmove({nr}, {target} [, {options}]) 2917 win_splitmove({nr}, {target} [, {options}])
2916 Number move window {nr} to split of {target} 2918 Number move window {nr} to split of {target}
2917 winbufnr({nr}) Number buffer number of window {nr} 2919 winbufnr({nr}) Number buffer number of window {nr}
2918 wincol() Number window column of the cursor 2920 wincol() Number window column of the cursor
2921 windowsversion() String MS-Windows OS version
2919 winheight({nr}) Number height of window {nr} 2922 winheight({nr}) Number height of window {nr}
2920 winlayout([{tabnr}]) List layout of windows in tab {tabnr} 2923 winlayout([{tabnr}]) List layout of windows in tab {tabnr}
2921 winline() Number window line of the cursor 2924 winline() Number window line of the cursor
2922 winnr([{expr}]) Number number of current window 2925 winnr([{expr}]) Number number of current window
2923 winrestcmd() String returns command to restore window sizes 2926 winrestcmd() String returns command to restore window sizes
10219 Can also be used as a |method|: > 10222 Can also be used as a |method|: >
10220 GetText()->tr(from, to) 10223 GetText()->tr(from, to)
10221 10224
10222 trim({text} [, {mask}]) *trim()* 10225 trim({text} [, {mask}]) *trim()*
10223 Return {text} as a String where any character in {mask} is 10226 Return {text} as a String where any character in {mask} is
10224 removed from the beginning and end of {text}. 10227 removed from the beginning and end of {text}.
10225 If {mask} is not given, {mask} is all characters up to 0x20, 10228 If {mask} is not given, {mask} is all characters up to 0x20,
10226 which includes Tab, space, NL and CR, plus the non-breaking 10229 which includes Tab, space, NL and CR, plus the non-breaking
10227 space character 0xa0. 10230 space character 0xa0.
10228 This code deals with multibyte characters properly. 10231 This code deals with multibyte characters properly.
10229 10232
11142 replaced. Unless it is currently being executed, that 11145 replaced. Unless it is currently being executed, that
11143 is an error. 11146 is an error.
11144 NOTE: Use ! wisely. If used without care it can cause 11147 NOTE: Use ! wisely. If used without care it can cause
11145 an existing function to be replaced unexpectedly, 11148 an existing function to be replaced unexpectedly,
11146 which is hard to debug. 11149 which is hard to debug.
11150 NOTE: In Vim9 script script-local functions cannot be
11151 deleted or redefined.
11147 11152
11148 For the {arguments} see |function-argument|. 11153 For the {arguments} see |function-argument|.
11149 11154
11150 *:func-range* *a:firstline* *a:lastline* 11155 *:func-range* *a:firstline* *a:lastline*
11151 When the [range] argument is added, the function is 11156 When the [range] argument is added, the function is