diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2021-08-26 04:26:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-26 04:26:32 -0700 |
| commit | 4c499899b2c3b31d57c1911c522683bdb2e32a0a (patch) | |
| tree | 73bd8630718e854355ae1cc9c4272838618b67c9 | |
| parent | 2548a9e18037339c4c502d971bdeaf909b82a739 (diff) | |
| parent | b2994e35c9357a8144beaf27e1a8ea4dd133f5d4 (diff) | |
| download | rneovim-4c499899b2c3b31d57c1911c522683bdb2e32a0a.tar.gz rneovim-4c499899b2c3b31d57c1911c522683bdb2e32a0a.tar.bz2 rneovim-4c499899b2c3b31d57c1911c522683bdb2e32a0a.zip | |
Merge #15293 Vimscript "method" syntax
Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
39 files changed, 1421 insertions, 418 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e02d80252f..87240831a2 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -669,12 +669,14 @@ Expression syntax summary, from least to most significant: expr8[expr1 : expr1] substring of a String or sublist of a |List| expr8.name entry in a |Dictionary| expr8(expr1, ...) function call with |Funcref| variable + expr8->name(expr1, ...) |method| call |expr9| number number constant "string" string constant, backslash is special 'string' string constant, ' is doubled [expr1, ...] |List| {expr1: expr1, ...} |Dictionary| + #{key: expr1, ...} |Dictionary| &option option value (expr1) nested expression variable internal variable @@ -939,9 +941,11 @@ expr8 *expr8* ----- This expression is either |expr9| or a sequence of the alternatives below, in any order. E.g., these are all possible: - expr9[expr1].name - expr9.name[expr1] - expr9(expr1, ...)[expr1].name + expr8[expr1].name + expr8.name[expr1] + expr8(expr1, ...)[expr1].name + expr8->(expr1, ...)[expr1] +Evaluation is always from left to right. expr8[expr1] item of String or |List| *expr-[]* *E111* @@ -1043,6 +1047,36 @@ expr8(expr1, ...) |Funcref| function call When expr8 is a |Funcref| type variable, invoke the function it refers to. +expr8->name([args]) method call *method* *->* +expr8->{lambda}([args]) + +For methods that are also available as global functions this is the same as: > + name(expr8 [, args]) +There can also be methods specifically for the type of "expr8". + +This allows for chaining, passing the value that one method returns to the +next method: > + mylist->filter(filterexpr)->map(mapexpr)->sort()->join() +< +Example of using a lambda: > + GetPercentage->{x -> x * 100}()->printf('%d%%') +< +When using -> the |expr7| operators will be applied first, thus: > + -1.234->string() +Is equivalent to: > + (-1.234)->string() +And NOT: > + -(1.234->string()) +< + *E274* +"->name(" must not contain white space. There can be white space before the +"->" and after the "(", thus you can split the lines like this: > + mylist + \ ->filter(filterexpr) + \ ->map(mapexpr) + \ ->sort() + \ ->join() +< *expr9* number @@ -2583,6 +2617,8 @@ abs({expr}) *abs()* echo abs(-4) < 4 + Can also be used as a |method|: > + Compute()->abs() acos({expr}) *acos()* Return the arc cosine of {expr} measured in radians, as a @@ -2595,6 +2631,8 @@ acos({expr}) *acos()* :echo acos(-0.5) < 2.094395 + Can also be used as a |method|: > + Compute()->acos() add({list}, {expr}) *add()* Append the item {expr} to |List| {list}. Returns the @@ -2605,12 +2643,16 @@ add({list}, {expr}) *add()* item. Use |extend()| to concatenate |Lists|. Use |insert()| to add an item at another position. + Can also be used as a |method|: > + mylist->add(val1)->add(val2) and({expr}, {expr}) *and()* Bitwise AND on the two arguments. The arguments are converted to a number. A List, Dict or Float argument causes an error. Example: > :let flag = and(bits, 0x80) +< Can also be used as a |method|: > + :let flag = bits->and(0x80) api_info() *api_info()* Returns Dictionary of |api-metadata|. @@ -2629,6 +2671,9 @@ append({lnum}, {text}) *append()* :let failed = append(line('$'), "# THE END") :let failed = append(0, ["Chapter 1", "the beginning"]) +< Can also be used as a |method| after a List: > + mylist->append(lnum) + appendbufline({expr}, {lnum}, {text}) *appendbufline()* Like |append()| but append the text in buffer {expr}. @@ -2647,8 +2692,10 @@ appendbufline({expr}, {lnum}, {text}) *appendbufline()* error message is given. Example: > :let failed = appendbufline(13, 0, "# THE START") < - *argc()* -argc([{winid}]) + Can also be used as a |method| after a List: > + mylist->appendbufline(buf, lnum) + +argc([{winid}]) *argc()* The result is the number of files in the argument list. See |arglist|. If {winid} is not supplied, the argument list of the current @@ -2702,6 +2749,9 @@ asin({expr}) *asin()* :echo asin(-0.5) < -0.523599 + Can also be used as a |method|: > + Compute()->asin() + assert_ functions are documented here: |assert-functions-details| @@ -2716,6 +2766,8 @@ atan({expr}) *atan()* :echo atan(-4.01) < -1.326405 + Can also be used as a |method|: > + Compute()->atan() atan2({expr1}, {expr2}) *atan2()* Return the arc tangent of {expr1} / {expr2}, measured in @@ -2727,6 +2779,8 @@ atan2({expr1}, {expr2}) *atan2()* :echo atan2(1, -1) < 2.356194 + Can also be used as a |method|: > + Compute()->atan2(1) *browse()* browse({save}, {title}, {initdir}, {default}) @@ -2737,8 +2791,8 @@ browse({save}, {title}, {initdir}, {default}) {title} title for the requester {initdir} directory to start browsing in {default} default file name - When the "Cancel" button is hit, something went wrong, or - browsing is not possible, an empty string is returned. + An empty string is returned when the "Cancel" button is hit, + something went wrong, or browsing is not possible. *browsedir()* browsedir({title}, {initdir}) @@ -2760,6 +2814,8 @@ bufadd({name}) *bufadd()* created buffer. When {name} is an empty string then a new buffer is always created. The buffer will not have' 'buflisted' set. +< Can also be used as a |method|: > + let bufnr = 'somename'->bufadd() bufexists({expr}) *bufexists()* The result is a Number, which is |TRUE| if a buffer called @@ -2783,11 +2839,17 @@ bufexists({expr}) *bufexists()* Use "bufexists(0)" to test for the existence of an alternate file name. + Can also be used as a |method|: > + let exists = 'somename'->bufexists() + buflisted({expr}) *buflisted()* The result is a Number, which is |TRUE| if a buffer called {expr} exists and is listed (has the 'buflisted' option set). The {expr} argument is used like with |bufexists()|. + Can also be used as a |method|: > + let listed = 'somename'->buflisted() + bufload({expr}) *bufload()* Ensure the buffer {expr} is loaded. When the buffer name refers to an existing file then the file is read. Otherwise @@ -2797,15 +2859,21 @@ bufload({expr}) *bufload()* there will be no dialog, the buffer will be loaded anyway. The {expr} argument is used like with |bufexists()|. + Can also be used as a |method|: > + eval 'somename'->bufload() + bufloaded({expr}) *bufloaded()* The result is a Number, which is |TRUE| if a buffer called {expr} exists and is loaded (shown in a window or hidden). The {expr} argument is used like with |bufexists()|. + Can also be used as a |method|: > + let loaded = 'somename'->bufloaded() + bufname([{expr}]) *bufname()* The result is the name of a buffer, as it is displayed by the ":ls" command. -+ If {expr} is omitted the current buffer is used. + If {expr} is omitted the current buffer is used. If {expr} is a Number, that buffer number's name is given. Number zero is the alternate buffer for the current window. If {expr} is a String, it is used as a |file-pattern| to match @@ -2824,6 +2892,9 @@ bufname([{expr}]) *bufname()* If the {expr} is a String, but you want to use it as a buffer number, force it to be a Number by adding zero to it: > :echo bufname("3" + 0) +< Can also be used as a |method|: > + echo bufnr->bufname() + < If the buffer doesn't exist, or doesn't have a name, an empty string is returned. > bufname("#") alternate buffer name @@ -2846,6 +2917,9 @@ bufnr([{expr} [, {create}]]) number necessarily exist, because ":bwipeout" may have removed them. Use bufexists() to test for the existence of a buffer. + Can also be used as a |method|: > + echo bufref->bufnr() + bufwinid({expr}) *bufwinid()* The result is a Number, which is the |window-ID| of the first window associated with buffer {expr}. For the use of {expr}, @@ -2856,18 +2930,22 @@ bufwinid({expr}) *bufwinid()* < Only deals with the current tab page. + Can also be used as a |method|: > + FindBuffer()->bufwinid() + bufwinnr({expr}) *bufwinnr()* - The result is a Number, which is the number of the first - window associated with buffer {expr}. For the use of {expr}, - see |bufname()| above. If buffer {expr} doesn't exist or - there is no such window, -1 is returned. Example: > + Like |bufwinid()| but return the window number instead of the + |window-ID|. + If buffer {expr} doesn't exist or there is no such window, -1 + is returned. Example: > echo "A window containing buffer 1 is " . (bufwinnr(1)) < The number can be used with |CTRL-W_w| and ":wincmd w" |:wincmd|. - Only deals with the current tab page. + Can also be used as a |method|: > + FindBuffer()->bufwinnr() byte2line({byte}) *byte2line()* Return the line number that contains the character at byte @@ -2877,6 +2955,9 @@ byte2line({byte}) *byte2line()* one. Also see |line2byte()|, |go| and |:goto|. + Can also be used as a |method|: > + GetOffset()->byte2line() + byteidx({expr}, {nr}) *byteidx()* Return byte index of the {nr}'th character in the string {expr}. Use zero for the first character, it then returns @@ -2899,6 +2980,9 @@ byteidx({expr}, {nr}) *byteidx()* If there are exactly {nr} characters the length of the string in bytes is returned. + Can also be used as a |method|: > + GetName()->byteidx(idx) + byteidxcomp({expr}, {nr}) *byteidxcomp()* Like byteidx(), except that a composing character is counted as a separate character. Example: > @@ -2912,6 +2996,9 @@ byteidxcomp({expr}, {nr}) *byteidxcomp()* Only works differently from byteidx() when 'encoding' is set to a Unicode encoding. + Can also be used as a |method|: > + GetName()->byteidxcomp(idx) + call({func}, {arglist} [, {dict}]) *call()* *E699* Call function {func} with the items in |List| {arglist} as arguments. @@ -2921,6 +3008,9 @@ call({func}, {arglist} [, {dict}]) *call()* *E699* {dict} is for functions with the "dict" attribute. It will be used to set the local variable "self". |Dictionary-function| + Can also be used as a |method|: > + GetFunc()->call([arg, arg], dict) + ceil({expr}) *ceil()* Return the smallest integral value greater than or equal to {expr} as a |Float| (round up). @@ -2933,6 +3023,9 @@ ceil({expr}) *ceil()* echo ceil(4.0) < 4.0 + Can also be used as a |method|: > + Compute()->ceil() + changenr() *changenr()* Return the number of the most recent change. This is the same number as what is displayed with |:undolist| and can be used @@ -2982,6 +3075,9 @@ char2nr({expr} [, {utf8}]) *char2nr()* A combining character is a separate character. |nr2char()| does the opposite. + Can also be used as a |method|: > + GetChar()->char2nr() + *charidx()* charidx({string}, {idx} [, {countcc}]) Return the character index of the byte at {idx} in {string}. @@ -3013,12 +3109,18 @@ cindent({lnum}) *cindent()* When {lnum} is invalid -1 is returned. See |C-indenting|. + Can also be used as a |method|: > + GetLnum()->cindent() + clearmatches([{win}]) *clearmatches()* Clears all matches previously defined for the current window by |matchadd()| and the |:match| commands. If {win} is specified, use the window with this number or window ID instead of the current window. + Can also be used as a |method|: > + GetWin()->clearmatches() +< *col()* col({expr}) The result is a Number, which is the byte index of the column position given with {expr}. The accepted positions are: @@ -3054,6 +3156,9 @@ col({expr}) The result is a Number, which is the byte index of the column \<C-O>:set ve=all<CR> \<C-O>:echo col(".") . "\n" <Bar> \let &ve = save_ve<CR> + +< Can also be used as a |method|: > + GetPos()->col() < complete({startcol}, {matches}) *complete()* *E785* @@ -3085,6 +3190,10 @@ complete({startcol}, {matches}) *complete()* *E785* < This isn't very useful, but it shows how it works. Note that an empty string is returned to avoid a zero being inserted. + Can also be used as a |method|, the second argument is passed + in: > + GetMatches()->complete(col('.')) + complete_add({expr}) *complete_add()* Add {expr} to the list of matches. Only to be used by the function specified with the 'completefunc' option. @@ -3094,6 +3203,9 @@ complete_add({expr}) *complete_add()* See |complete-functions| for an explanation of {expr}. It is the same as one item in the list that 'omnifunc' would return. + Can also be used as a |method|: > + GetMoreMatches()->complete_add() + complete_check() *complete_check()* Check for a key typed while looking for completion matches. This is to be used when looking for matches takes some time. @@ -3154,6 +3266,9 @@ complete_info([{what}]) call complete_info(['mode']) " Get only 'mode' and 'pum_visible' call complete_info(['mode', 'pum_visible']) + +< Can also be used as a |method|: > + GetItems()->complete_info() < *confirm()* confirm({msg} [, {choices} [, {default} [, {type}]]]) @@ -3207,6 +3322,9 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) don't fit, a vertical layout is used anyway. For some systems the horizontal layout is always used. + Can also be used as a |method|in: > + BuildMessage()->confirm("&Yes\n&No") + *copy()* copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't different from using {expr} directly. @@ -3216,6 +3334,8 @@ copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't changing an item changes the contents of both |Lists|. A |Dictionary| is copied in a similar way as a |List|. Also see |deepcopy()|. + Can also be used as a |method|: > + mylist->copy() cos({expr}) *cos()* Return the cosine of {expr}, measured in radians, as a |Float|. @@ -3226,6 +3346,8 @@ cos({expr}) *cos()* :echo cos(-4.01) < -0.646043 + Can also be used as a |method|: > + Compute()->cos() cosh({expr}) *cosh()* Return the hyperbolic cosine of {expr} as a |Float| in the range @@ -3237,6 +3359,8 @@ cosh({expr}) *cosh()* :echo cosh(-0.5) < -1.127626 + Can also be used as a |method|: > + Compute()->cosh() count({comp}, {expr} [, {ic} [, {start}]]) *count()* Return the number of times an item with value {expr} appears @@ -3251,6 +3375,9 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()* occurrences of {expr} is returned. Zero is returned when {expr} is an empty string. + Can also be used as a |method|: > + mylist->count(val) + *cscope_connection()* cscope_connection([{num} , {dbpath} [, {prepend}]]) Checks for the existence of a |cscope| connection. If no @@ -3346,6 +3473,8 @@ cursor({list}) position within a <Tab> or after the last character. Returns 0 when the position could be set, -1 otherwise. + Can also be used as a |method|: > + GetCursorPos()->cursor() deepcopy({expr}[, {noref}]) *deepcopy()* *E698* Make a copy of {expr}. For Numbers and Strings this isn't @@ -3367,6 +3496,9 @@ deepcopy({expr}[, {noref}]) *deepcopy()* *E698* {noref} set to 1 will fail. Also see |copy()|. + Can also be used as a |method|: > + GetObject()->deepcopy() + delete({fname} [, {flags}]) *delete()* Without {flags} or with {flags} empty: Deletes the file by the name {fname}. This also works when {fname} is a symbolic link. @@ -3384,6 +3516,9 @@ delete({fname} [, {flags}]) *delete()* operation was successful and -1/true when the deletion failed or partly failed. + Can also be used as a |method|: > + GetName()->delete() + deletebufline({expr}, {first}[, {last}]) *deletebufline()* Delete lines {first} to {last} (inclusive) from buffer {expr}. If {last} is omitted then delete line {first} only. @@ -3398,6 +3533,9 @@ deletebufline({expr}, {first}[, {last}]) *deletebufline()* when using |line()| this refers to the current buffer. Use "$" to refer to the last line in buffer {expr}. + Can also be used as a |method|: > + GetBuffer()->deletebufline(1) + dictwatcheradd({dict}, {pattern}, {callback}) *dictwatcheradd()* Adds a watcher to a dictionary. A dictionary watcher is identified by three components: @@ -3464,6 +3602,9 @@ diff_filler({lnum}) *diff_filler()* line, "'m" mark m, etc. Returns 0 if the current window is not in diff mode. + Can also be used as a |method|: > + GetLnum()->diff_filler() + diff_hlID({lnum}, {col}) *diff_hlID()* Returns the highlight ID for diff mode at line {lnum} column {col} (byte index). When the current line does not have a @@ -3475,11 +3616,16 @@ diff_hlID({lnum}, {col}) *diff_hlID()* The highlight ID can be used with |synIDattr()| to obtain syntax information about the highlighting. + Can also be used as a |method|: > + GetLnum()->diff_hlID(col) + empty({expr}) *empty()* Return the Number 1 if {expr} is empty, zero otherwise. A |List| or |Dictionary| is empty when it does not have any items. A Number is empty when its value is zero. Special variable is empty when it is |v:false| or |v:null|. + Can also be used as a |method|: > + mylist->empty() environ() *environ()* Return all of environment variables as dictionary. You can @@ -3504,6 +3650,9 @@ eval({string}) Evaluate {string} and return the result. Especially useful to them. Also works for |Funcref|s that refer to existing functions. + Can also be used as a |method|: > + argv->join()->eval() + eventhandler() *eventhandler()* Returns 1 when inside an event handler. That is that Vim got interrupted while waiting for the user to type a character, @@ -3661,12 +3810,18 @@ exp({expr}) *exp()* :echo exp(-1) < 0.367879 + Can also be used as a |method|: > + Compute()->exp() + debugbreak({pid}) *debugbreak()* Specifically used to interrupt a program being debugged. It will cause process {pid} to get a SIGTRAP. Behavior for other processes is undefined. See |terminal-debugger|. {Sends a SIGINT to a process {pid} other than MS-Windows} + Can also be used as a |method|: > + GetPid()->debugbreak() + expand({expr} [, {nosuf} [, {list}]]) *expand()* Expand wildcards and the following special keywords in {expr}. 'wildignorecase' applies. @@ -3795,6 +3950,8 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()* fails. Returns {expr1}. + Can also be used as a |method|: > + mylist->extend(otherlist) feedkeys({string} [, {mode}]) *feedkeys()* Characters in {string} are queued for processing as if they @@ -3848,7 +4005,11 @@ filereadable({file}) *filereadable()* expression, which is used as a String. If you don't care about the file being readable you can use |glob()|. - + {file} is used as-is, you may want to expand wildcards first: > + echo filereadable('~/.vimrc') + 0 + echo filereadable(expand('~/.vimrc')) + 1 filewritable({file}) *filewritable()* The result is a Number, which is 1 when a file with the @@ -3904,6 +4065,8 @@ filter({expr1}, {expr2}) *filter()* Funcref errors inside a function are ignored, unless it was defined with the "abort" flag. + Can also be used as a |method|: > + mylist->filter(expr2) finddir({name} [, {path} [, {count}]]) *finddir()* Find directory {name} in {path}. Supports both downwards and @@ -3966,6 +4129,8 @@ float2nr({expr}) *float2nr()* echo float2nr(1.0e-100) < 0 + Can also be used as a |method|: > + Compute()->float2nr() floor({expr}) *floor()* Return the largest integral value less than or equal to @@ -3979,6 +4144,8 @@ floor({expr}) *floor()* echo floor(4.0) < 4.0 + Can also be used as a |method|: > + Compute()->floor() fmod({expr1}, {expr2}) *fmod()* Return the remainder of {expr1} / {expr2}, even if the @@ -3994,6 +4161,8 @@ fmod({expr1}, {expr2}) *fmod()* :echo fmod(-12.33, 1.22) < -0.13 + Can also be used as a |method|: > + Compute()->fmod(1.22) fnameescape({string}) *fnameescape()* Escape {string} for use as file name command argument. All @@ -4160,6 +4329,8 @@ get({list}, {idx} [, {default}]) *get()* Get item {idx} from |List| {list}. When this item is not available return {default}. Return zero when {default} is omitted. + Can also be used as a |method|: > + mylist->get(idx) get({dict}, {key} [, {default}]) Get item with key {key} from |Dictionary| {dict}. When this item is not available return {default}. Return zero when @@ -5171,6 +5342,9 @@ has_key({dict}, {key}) *has_key()* The result is a Number, which is TRUE if |Dictionary| {dict} has an entry with key {key}. FALSE otherwise. + Can also be used as a |method|: > + mydict->has_key(key) + haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()* The result is a Number, which is 1 when the tabpage or window has set a local path via |:tcd| or |:lcd|, otherwise 0. @@ -5514,6 +5688,9 @@ insert({list}, {item} [, {idx}]) *insert()* Note that when {item} is a |List| it is inserted as a single item. Use |extend()| to concatenate |Lists|. + Can also be used as a |method|: > + mylist->insert(item) + interrupt() *interrupt()* Interrupt script execution. It works more or less like the user typing CTRL-C, most commands won't execute and control @@ -5531,6 +5708,8 @@ invert({expr}) *invert()* Bitwise invert. The argument is converted to a number. A List, Dict or Float argument causes an error. Example: > :let bits = invert(bits) +< Can also be used as a |method|: > + :let bits = bits->invert() isdirectory({directory}) *isdirectory()* The result is a Number, which is |TRUE| when a directory @@ -5546,6 +5725,9 @@ isinf({expr}) *isinf()* :echo isinf(-1.0 / 0.0) < -1 + Can also be used as a |method|: > + Compute()->isinf() + islocked({expr}) *islocked()* *E786* The result is a Number, which is |TRUE| when {expr} is the name of a locked variable. @@ -5581,12 +5763,17 @@ items({dict}) *items()* |List| item is a list with two items: the key of a {dict} entry and the value of this entry. The |List| is in arbitrary order. + Can also be used as a |method|: > + mydict->items() isnan({expr}) *isnan()* Return |TRUE| if {expr} is a float with value NaN. > echo isnan(0.0 / 0.0) < 1 + Can also be used as a |method|: > + Compute()->isnan() + jobpid({job}) *jobpid()* Return the PID (process id) of |job-id| {job}. @@ -5714,6 +5901,9 @@ join({list} [, {sep}]) *join()* converted into a string like with |string()|. The opposite function is |split()|. + Can also be used as a |method|: > + mylist->join() + json_decode({expr}) *json_decode()* Convert {expr} from JSON object. Accepts |readfile()|-style list as the input, as well as regular string. May output any @@ -5744,8 +5934,10 @@ json_encode({expr}) *json_encode()* keys({dict}) *keys()* Return a |List| with all the keys of {dict}. The |List| is in arbitrary order. + Can also be used as a |method|: > + mydict->keys() - *len()* *E701* +< *len()* *E701* len({expr}) The result is a Number, which is the length of the argument. When {expr} is a String or a Number the length in bytes is used, as with |strlen()|. @@ -5756,7 +5948,10 @@ len({expr}) The result is a Number, which is the length of the argument. |Dictionary| is returned. Otherwise an error is given. - *libcall()* *E364* *E368* + Can also be used as a |method|: > + mylist->len() + +< *libcall()* *E364* *E368* libcall({libname}, {funcname}, {argument}) Call function {funcname} in the run-time library {libname} with single argument {argument}. @@ -5881,6 +6076,8 @@ log({expr}) *log()* :echo log(exp(5)) < 5.0 + Can also be used as a |method|: > + Compute()->log() log10({expr}) *log10()* Return the logarithm of Float {expr} to base 10 as a |Float|. @@ -5891,6 +6088,9 @@ log10({expr}) *log10()* :echo log10(0.01) < -2.0 + Can also be used as a |method|: > + Compute()->log10() + luaeval({expr}[, {expr}]) Evaluate Lua expression {expr} and return its result converted to Vim data structures. See |lua-eval| for more details. @@ -5939,6 +6139,8 @@ map({expr1}, {expr2}) *map()* Funcref errors inside a function are ignored, unless it was defined with the "abort" flag. + Can also be used as a |method|: > + mylist->map(expr2) maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* When {dict} is omitted or zero: Return the rhs of mapping @@ -6274,6 +6476,9 @@ max({expr}) Return the maximum value of all items in {expr}. items in {expr} cannot be used as a Number this results in |