vim9script _vimrc COMPATIBILITY with autocommand

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

vim9script _vimrc COMPATIBILITY with autocommand

Ni Va
Hi,


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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/a54815fc-c0cb-4b5c-a9f2-715f0afe667en%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim9script _vimrc COMPATIBILITY with autocommand

Bram Moolenaar


> 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 -- [hidden email] -- 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    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/202012181139.0BIBdjdv1229583%40masaka.moolenaar.net.
Reply | Threaded
Open this post in threaded view
|

Re: vim9script _vimrc COMPATIBILITY with autocommand

Ni Va
So it's not possible to have in the same Vim distro:
 _vimrc in vim9script 
 filetype.vim with autocommand in vimscript

?

Le vendredi 18 décembre 2020 à 12:40:49 UTC+1, Bram Moolenaar a écrit :


> 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 -- [hidden email] -- 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 ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/401d6f23-84d9-462b-a472-829fb666d69an%40googlegroups.com.