Open zambotn opened 1 year ago
Hey, thanks for the report. I can confirm your example breaks syntax highlighting.
Can you check whether this problem persists with the upstream vim plugin?
It does work properly in the upstream vim plugin you sent me, although it doesn't provide Lua syntax and keeps using nginx one (in the image you can see no LUA code is highlighted, and the Lua comment is not highlighted as a comment).
I am not a Vim syntax guru, but my feeling (so it can be a wrong feeling) is that the issue is generating because ngxLua
, luaError
and luaTableBlock
all ends with }
and the priority is given to the later matching one (so the one inside the Lua syntax?). I didn't study the Vim syntax and I have not much time to do so in those days. I rembember there is the keepend
option but it will stop matching to the first match, unless extend
is used on contained elements, which we cannot control since those elements are in the Lua syntax.
I can confirm this issue. I'll look into it when I find the time, pull requests welcome!
When I am embedding LUA code in nginx.conf highlights breaks.
using VimR Version 0.43.0 (20221115.195322), which itself is using NeoVim 0.8.1 is rendered as follow:
there are different problems and I don't know if they are related or not:
closed parenthesis is always grouped as
luaParenError
.It looks like the
ngxLua
region starts but doesn't end with the matching}
(i.e. the lines starting with#
in the NGINX part, later on, are not marked as comments).