Broken syntax highlighting when .html.twig
Closed this issue · 6 comments
I noticed one problem today, didn't happen before. When i load file which has .html.twig, syntax highlighting doesnt work properly:
when it's only .twig, it works fine.
Biggest problem in this is that i can't use my html snippets because the filetype doesn't contain html. Do you know what could be the issue here? Thanks.
I noticed if i do set ft=twig.html
everything works fine, but with set ft=html.twig
its broken like on first image. Really strange behavior. Is anyone else maybe have this issue?
Using 7.4. Tested on both Mac OS and Xubuntu, same issue. Your fix is also working for me. Basically its enough to add on https://github.com/evidens/vim-twig/blob/master/syntax/twig.vim#L22 additional check && b:current_syntax == 'twig'
, so we don't break the initial idea. Will you do the pull request or i do it?
yeah, an additional check is better than removing, so no breaking changes with the older versions 👍
As you've suggested the right fix, you might send the PR :-)
ok, will do soon :)
Since both of the "broken highlighting" tickets are still open, I'll comment here..
A fresh install of latest vim + this plugin results in HTML not being highlighted.. It appears that b:main_syntax
is set and is equal to htmldjango
, not sure why that happens