mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-08 13:44:46 +08:00
Improve code and performance
This commit is contained in:
@@ -41,19 +41,19 @@ let s:match_option =
|
||||
\.' contains='.s:contains
|
||||
\.' skipwhite skipempty'
|
||||
|
||||
execute 'syntax match vueObjectKey /'
|
||||
execute 'syntax match vueObjectKey display /'
|
||||
\.s:keywords_regexp
|
||||
\.'\s*:/'
|
||||
\.s:match_option
|
||||
\.' nextgroup=jsObjectValue'
|
||||
|
||||
execute 'syntax match vueObjectFuncName /'
|
||||
execute 'syntax match vueObjectFuncName display /'
|
||||
\.s:keywords_regexp
|
||||
\.'\_s*\(/'
|
||||
\.s:match_option
|
||||
\.' nextgroup=jsFuncArgs'
|
||||
|
||||
execute 'syntax match vueObjectFuncKey /'
|
||||
execute 'syntax match vueObjectFuncKey display /'
|
||||
\.s:keywords_regexp
|
||||
\.'\s*:\s*function>/'
|
||||
\.s:match_option
|
||||
@@ -67,7 +67,7 @@ let s:vue3_keywords_regexp = '\v<('
|
||||
\.join(split(s:vue3_keywords, ' '), '|')
|
||||
\.')\ze'
|
||||
|
||||
execute 'syntax match vue3Keyword /'
|
||||
execute 'syntax match vue3Keyword display /'
|
||||
\.s:vue3_keywords_regexp
|
||||
\.'\_s*\(/'
|
||||
\.s:match_option
|
||||
|
||||
@@ -136,7 +136,7 @@ function! s:HighlightVueTag()
|
||||
endfunction
|
||||
|
||||
function! s:SetSyntaxSync()
|
||||
syntax sync fromstart
|
||||
" syntax sync fromstart
|
||||
endfunction
|
||||
|
||||
function! s:SetIsKeyword()
|
||||
@@ -151,7 +151,7 @@ function! s:SetIsKeyword()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! VimVuePluginSyntaxMain(id)
|
||||
function! VimVuePluginSyntaxMain(...)
|
||||
call s:Init()
|
||||
let syntax_list = vue#GetSyntaxList(s:config_syntax)
|
||||
call s:LoadSyntaxList(syntax_list)
|
||||
@@ -161,7 +161,10 @@ function! VimVuePluginSyntaxMain(id)
|
||||
call s:HighlightVueTag()
|
||||
endfunction
|
||||
|
||||
" call timer_start(10, 'VimVuePluginSyntaxMain')
|
||||
call VimVuePluginSyntaxMain(0)
|
||||
if exists('*timer_start')
|
||||
call timer_start(1, 'VimVuePluginSyntaxMain')
|
||||
else
|
||||
call VimVuePluginSyntaxMain()
|
||||
endif
|
||||
|
||||
let b:current_syntax = 'vue'
|
||||
|
||||
Reference in New Issue
Block a user