You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a plugin has a after/syntax/lua.vim file, and this plugin gets loaded 'for': ['lua'], the main syntax plugin(s) (syntax/lua.vim) will not be loaded, when b:current_syntax might exist already.
Create a config.ld file, it will have ft=ld and b:current_syntax='ld'
set ft=lua (manually or through a modeline)
vim-plug will call runtime syntax/lua.vim, but that finishes, because b:current_syntax is set to 'ld' already.
Then after/syntax/lua.vim from the plugin gets sourced, and throws an error because of the unknown var.
I've noticed that passing in , syn, 'after/'.syn to s:lod will even cause it to be loaded twice in the end?!
So the following would actually fix it for this use case, but breaks the "Filetype-based on-demand loading" test ('xxx/syntax', 'xxx/after/syntax' is missing from g:xxx).
When testing it manually, the syntaxset FileType event will trigger the syntax files to be loaded automatically, but for some reason that is not happening during the tests, although the autocommand is there?!
Then run it with vim -Nu minimal.vim t.ld and call set ft=lua in Vim:
Error detected while processing /home/user/Vcs/vim-plug/t/p1/after/syntax/lua.vim:
line 1:
E121: Undefined variable: lua_version
E15: Invalid expression: lua_version
5
A fix for this might be to unlet! b:current_syntax in s:lod_ft, but then it will (still) cause the syntax files to be sourced twice - which seems to be wrong in the first place?!
The text was updated successfully, but these errors were encountered:
When a plugin has a
after/syntax/lua.vim
file, and this plugin gets loaded'for': ['lua']
, the main syntax plugin(s) (syntax/lua.vim
) will not be loaded, whenb:current_syntax
might exist already.In the case of https://github.com/raymond-w-ko/vim-lua-indent/blob/master/after/syntax/lua.vim#L7 this relies on a variable
lua_version
being set, but it gets not set from Vim'ssyntax/lua.vim
whenb:current_syntax
is set already.TEST CASE:
config.ld
file, it will haveft=ld
andb:current_syntax='ld'
set ft=lua
(manually or through a modeline)vim-plug will call
runtime syntax/lua.vim
, but that finishes, becauseb:current_syntax
is set to'ld'
already.Then
after/syntax/lua.vim
from the plugin gets sourced, and throws an error because of the unknown var.I've noticed that passing in
, syn, 'after/'.syn
tos:lod
will even cause it to be loaded twice in the end?!So the following would actually fix it for this use case, but breaks the "Filetype-based on-demand loading" test (
'xxx/syntax', 'xxx/after/syntax'
is missing fromg:xxx
).When testing it manually, the
syntaxset
FileType event will trigger the syntax files to be loaded automatically, but for some reason that is not happening during the tests, although the autocommand is there?!A test case (
t/minimal.vim
):With
p1/after/syntax/lua.vim
:echom lua_version
Then run it with
vim -Nu minimal.vim t.ld
and callset ft=lua
in Vim:A fix for this might be to
unlet! b:current_syntax
ins:lod_ft
, but then it will (still) cause the syntax files to be sourced twice - which seems to be wrong in the first place?!The text was updated successfully, but these errors were encountered: