Vim8.2.2154 html filetype detection cause error incompatiblity with vim9script

32 views
Skip to first unread message

Ni Va

unread,
Dec 18, 2020, 5:57:41 AM12/18/20
to vim_use
Hi,

When opening html file in new buffer while my _vimrc is written in vim9script,
this message appears:

Messages maintainer: Bram Moolenaar
"~\Desktop\filetype.vim.html" 2315L, 216123B
Error detected while processing BufRead Autocommands for "*.html"..function dist#ft#FThtml[13]..FileType Autocommands for "html":
E1126: Cannot use :let in Vim9 script
E1126: Cannot use :let in Vim9 script 

Tony Mechelynck

unread,
Dec 18, 2020, 1:53:33 PM12/18/20
to Bram Moolenaar, vim_use
IOW, a script (without vim9script in it) sourced from an autocommand
triggered from Vim9 script is erroneously interpreted as if it were
itself a Vim9 script.

Best regards,
Tony.

Bram Moolenaar

unread,
Dec 19, 2020, 7:32:55 AM12/19/20
to vim...@googlegroups.com, Tony Mechelynck
What is the line in the vimrc then?


The error points to the FThtml() function in
runtime/autoload/dis/ft.vim,
the command:
setf FALLBACK html

I guess there is an "au Filetype html" command that is triggered then,
but I can't reproduce a problem with that.

--
CRONE: Who sent you?
ARTHUR: The Knights Who Say GNU!
CRONE: Aaaagh! (she looks around in rear) No! We have no licenses here.
"Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE 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 21, 2020, 3:48:42 AM12/21/20
to vim_use
Hi Bram,

  • The only line I got grepping in all my Vim distribution is commented in _vimrc.


title: some title
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks! 

Thank you.

Ni Va

unread,
Dec 21, 2020, 3:57:43 AM12/21/20
to vim_use
This is line I got in _vimrc vim9script : # autocmd FileType html   let b:dispatch = 'chrome %'



Ni Va

unread,
Dec 21, 2020, 4:03:15 AM12/21/20
to vim...@googlegroups.com
In screeshot the only commented line I got grepping au Filetype html in all my distribution.

--
--
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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/X3Ndrb_gFpk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/befd416c-340b-4664-b2af-cc4406e83c8cn%40googlegroups.com.
Capture.PNG

Ni Va

unread,
Dec 21, 2020, 9:14:51 AM12/21/20
to vim_use
 Solved by migrating this plugin from vimscript to vim9script (adding feature to auto open file in web browser on windows).

Ni Va

unread,
Dec 21, 2020, 9:28:58 AM12/21/20
to vim_use
Reply all
Reply to author
Forward
0 new messages