forked from aniani/vim
patch 8.2.4416: Vim9: using a script-local function requires using "s:"
Problem: Vim9: using a script-local function requires using "s:" when setting 'completefunc'. Solution: Do not require "s:" in Vim9 script. (closes #9796)
This commit is contained in:
@@ -383,12 +383,22 @@ lambda it will be converted to the name, e.g. "<lambda>123". Examples:
|
||||
set opfunc=function('MyOpFunc')
|
||||
set opfunc=funcref('MyOpFunc')
|
||||
set opfunc={a\ ->\ MyOpFunc(a)}
|
||||
" set using a funcref variable
|
||||
|
||||
Set to a script-local function: >
|
||||
set opfunc=s:MyLocalFunc
|
||||
set opfunc=<SID>MyLocalFunc
|
||||
In |Vim9| script the "s:" and "<SID>" can be omitted if the function exists in
|
||||
the script: >
|
||||
set opfunc=MyLocalFunc
|
||||
|
||||
Set using a funcref variable: >
|
||||
let Fn = function('MyTagFunc')
|
||||
let &tagfunc = Fn
|
||||
" set using a lambda expression
|
||||
|
||||
Set using a lambda expression: >
|
||||
let &tagfunc = {t -> MyTagFunc(t)}
|
||||
" set using a variable with lambda expression
|
||||
|
||||
Set using a variable with lambda expression: >
|
||||
let L = {a, b, c -> MyTagFunc(a, b , c)}
|
||||
let &tagfunc = L
|
||||
|
||||
|
Reference in New Issue
Block a user