Vim9: Not able to use a script local function name in the RHS of an assignment

6 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Dec 12, 2021, 7:56:29 PM12/12/21
to vim_dev
Hi,

In a Vim9 script, I am not able to use a script local function in the RHS of an
assignment at the script level. But I am able to use it a def function:

----------------------------------------------------------------------------------------------
vim9script

func s:F()
endfunc

def T()
var Fn1: func = s:F
enddef
T()

var Fn2: func = s:F
----------------------------------------------------------------------------------------------

If you source the above script, you will get a "E121: Undefined variable: s:F"
error message at line 10.

This works if you remove the "s:" prefix.

- Yegappan
Reply all
Reply to author
Forward
0 new messages