mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-10 22:51:52 +08:00
Fix syntax sync being cleared issue
This commit is contained in:
@@ -2,8 +2,12 @@
|
|||||||
" Maintainer: leaf <https://github.com/leafOfTree>
|
" Maintainer: leaf <https://github.com/leafOfTree>
|
||||||
" Credits: Inspired by mxw/vim-jsx.
|
" Credits: Inspired by mxw/vim-jsx.
|
||||||
|
|
||||||
if exists('b:current_syntax') && b:current_syntax == 'vue'
|
if !exists('g:main_syntax')
|
||||||
finish
|
if exists('b:current_syntax') && b:current_syntax == 'vue'
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
" Prevent 'syntax sync' from being cleared
|
||||||
|
let g:main_syntax = 'vue'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" <sfile> is replaced with the file name of the sourced file
|
" <sfile> is replaced with the file name of the sourced file
|
||||||
@@ -201,10 +205,14 @@ function! s:SetExtraSyntax()
|
|||||||
call s:SetCurrentSyntax()
|
call s:SetCurrentSyntax()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:ClearTimerVariable()
|
function! s:PostSetting()
|
||||||
if exists('s:main_timer')
|
if exists('s:main_timer')
|
||||||
unlet s:main_timer
|
unlet s:main_timer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists('g:main_syntax') && g:main_syntax == 'vue'
|
||||||
|
unlet g:main_syntax
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! VimVuePluginSyntaxMain(...)
|
function! VimVuePluginSyntaxMain(...)
|
||||||
@@ -213,7 +221,7 @@ function! VimVuePluginSyntaxMain(...)
|
|||||||
let syntax_list = vue#GetSyntaxList(s:config_syntax)
|
let syntax_list = vue#GetSyntaxList(s:config_syntax)
|
||||||
call s:LoadSyntaxList(syntax_list)
|
call s:LoadSyntaxList(syntax_list)
|
||||||
call s:SetExtraSyntax()
|
call s:SetExtraSyntax()
|
||||||
call s:ClearTimerVariable()
|
call s:PostSetting()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Entry
|
" Entry
|
||||||
|
|||||||
Reference in New Issue
Block a user