Skip to content

Commit 0959db0

Browse files
committed
Prevent css.vim from overriding syn-sync
Addresses #15
1 parent 3b370b6 commit 0959db0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

autoload/htl_syntax.vim

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function! htl_syntax#amend(options)
22

3-
let l:css_templates =(exists('g:htl_css_templates') && g:htl_css_templates)
4-
let l:all_templates =(exists('g:htl_all_templates') && g:htl_all_templates)
3+
let l:css_templates = (exists('g:htl_css_templates') && g:htl_css_templates)
4+
let l:all_templates = (exists('g:htl_all_templates') && g:htl_all_templates)
55

66
if exists('b:current_syntax')
77
let s:current_syntax=b:current_syntax
@@ -11,7 +11,8 @@ function! htl_syntax#amend(options)
1111
syn include @HTMLSyntax syntax/html.vim
1212
unlet g:main_syntax
1313
" we let/unlet g:main_syntax as a hack to prevent syntax/html.vim from
14-
" re-sourcing syntax/javascript.vim
14+
" re-sourcing syntax/javascript.vim. It also prevents syntax/html.vim from
15+
" ovoverridding syn-sync.
1516
if exists('s:current_syntax')
1617
let b:current_syntax=s:current_syntax
1718
endif
@@ -21,7 +22,11 @@ function! htl_syntax#amend(options)
2122
let s:current_syntax=b:current_syntax
2223
unlet b:current_syntax
2324
endif
25+
let g:main_syntax = 'not css'
2426
syn include @CSSSyntax syntax/css.vim
27+
unlet g:main_syntax
28+
" we let/unlet g:main_syntax to prevent syntax/css.vim from overridding
29+
" syn-sync.
2530
if exists('s:current_syntax')
2631
let b:current_syntax=s:current_syntax
2732
endif

0 commit comments

Comments
 (0)