:vim9cmd can't handle <SNR> without :call

11 views
Skip to first unread message

Christian J. Robinson

unread,
Jul 25, 2021, 6:36:33 PM7/25/21
to vim_dev, bu...@vim.org

 

    vim9script

 

    def Foo()

        echo "bar"

    enddef

 

    nmap <leader>foo :vim9cmd <SID>Foo()<CR>

 

This results in the error:

E1144: Command "<" is not followed by white space: <SNR>93_Foo()

 

If I use this instead, it works:

    nmap <leader>foo :vim9cmd call <SID>Foo()<CR>

 

Is this intended behavior?

 

 

Regards,

Christian

Bram Moolenaar

unread,
Jul 26, 2021, 3:10:50 PM7/26/21
to vim...@googlegroups.com, Christian J. Robinson, bu...@vim.org
The parsing wasn't prepared for encountering <SNR> at the start of a
command. That can be fixed.

--
"After a few years of marriage a man can look right at a woman
without seeing her and a woman can see right through a man
without looking at him."
- Helen Rowland

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages