Re: vim9script _vimrc COMPATIBILITY with autocommand

18 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 18, 2020, 6:40:49 AM12/18/20
to vim...@googlegroups.com, Ni Va


> Using this plugin GitHub - xavierchow/vim-sequence-diagram: A Vim plugin
> for previewing sequence diagram in a browser
> <https://github.com/xavierchow/vim-sequence-diagram>.
>
> Using Vim8.2.2154 32bits under win7 with _vimrc written in vim9script, the
> plugin aims to output html.
>
> But at reading this html outfile, through filetype detection or
> autocommand it fails like if transition vim9script to vimscript was not
> compatible.
>
> Anyone has and idea about this ?
>
>
> "~\AppData\Local\Temp\vim-js-seq\out.html" 0L, 0B
> Error detected while processing function vim_seq_diag#Generate_diagram[21]..
> BufRead Autocommands for "*.html"..function
> dist#ft#FThtml[13]..FileType Autocommands for "html":
> E1126: Cannot use :let in Vim9 script

When an autocommand is defined the context is remembered, so that when
it is executed the same context is used. This applies both to the
script ID and the script version.

I'm not sure exactly what happens here, but either the autocommand was
defined in Vim9 script but is using :let, or there is a bug somewhere.
You can perhaps set 'verbose' to a higher number to see what happens,
and from that make a reproducible example?

Note that disallowing :let in Vim9 script was change a few weeks ago, so
perhaps the script was written for an older version of Vim9 script.

--
DENNIS: You can't expect to wield supreme executive power just 'cause some
watery tart threw a sword at you!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Ni Va

unread,
Dec 18, 2020, 7:07:53 AM12/18/20
to vim_use
So it's not possible to have in the same Vim distro:
 _vimrc in vim9script 
 filetype.vim with autocommand in vimscript

?

Reply all
Reply to author
Forward
0 new messages