diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-06 21:08:20 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-12 22:35:22 +0100 |
commit | 5811390f82c51a4bb15b2e8901e6b5a1d453480a (patch) | |
tree | edff7b2d18c022ea8d46fe4bbae5c2fe7078d78b /runtime | |
parent | 32589341a41f49a11e68d5b080271115787f2dc5 (diff) | |
download | rneovim-5811390f82c51a4bb15b2e8901e6b5a1d453480a.tar.gz rneovim-5811390f82c51a4bb15b2e8901e6b5a1d453480a.tar.bz2 rneovim-5811390f82c51a4bb15b2e8901e6b5a1d453480a.zip |
vim-patch:8.1.1834: cannot use a lambda as a method
Problem: Cannot use a lambda as a method.
Solution: Implement ->{lambda}(). (closes vim/vim#4768)
https://github.com/vim/vim/commit/22a0c0c4ecd23b6c43f79ba9b92899ca0b426e29
Add an additional lua_funcname argument to call_func_rettv() to maintain
support for v:lua.
A memory leak was introduced with this patch that was fixed in
v8.1.2107.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b397328bc0..321da32bf0 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1047,7 +1047,8 @@ 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->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]) @@ -1057,6 +1058,9 @@ 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%%') + *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: > |