mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-10-14 00:48:59 +08:00
Refactor keywords regexp
This commit is contained in:
1 parent
042284ed01
commit
069ad44389
1 file changed
+4
-4
@@ -15,16 +15,16 @@ if !s:highlight_vue_keyword | finish | endif
|
|||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
let s:vue_keywords = 'name parent functional delimiters comments components directives filters extends mixins inheritAttrs model props propsData data computed watch methods template render renderError inject provide beforeCreate created beforeMount mounted beforeUpdate updated activated deactivated beforeDestroy destroyed'
|
let s:vue_keywords = 'name parent functional delimiters comments components directives filters extends mixins inheritAttrs model props propsData data computed watch methods template render renderError inject provide beforeCreate created beforeMount mounted beforeUpdate updated activated deactivated beforeDestroy destroyed'
|
||||||
|
|
||||||
let s:vue_keywords_regexp = join(split(s:vue_keywords, ' '), '|')
|
let s:vue_keywords_regexp = '\v<('.join(split(s:vue_keywords, ' '), '|').')\ze'
|
||||||
execute 'syntax match vueObjectKey /\v<('.s:vue_keywords_regexp.')\ze\s*:/'
|
execute 'syntax match vueObjectKey /'.s:vue_keywords_regexp.'\s*:/'
|
||||||
\.' containedin=jsObject,javascriptVueScript'
|
\.' containedin=jsObject,javascriptVueScript'
|
||||||
\.' skipwhite skipempty nextgroup=jsObjectValue'
|
\.' skipwhite skipempty nextgroup=jsObjectValue'
|
||||||
|
|
||||||
execute 'syntax match vueObjectFuncName /\v<('.s:vue_keywords_regexp.')\ze\_s*\(/'
|
execute 'syntax match vueObjectFuncName /'.s:vue_keywords_regexp.'\_s*\(/'
|
||||||
\.' containedin=jsObject,javascriptVueScript'
|
\.' containedin=jsObject,javascriptVueScript'
|
||||||
\.' skipwhite skipempty nextgroup=jsFuncArgs'
|
\.' skipwhite skipempty nextgroup=jsFuncArgs'
|
||||||
|
|
||||||
execute 'syntax match vueObjectFuncKey /\v<('.s:vue_keywords_regexp.')\ze\s*:\s*function>/'
|
execute 'syntax match vueObjectFuncKey /'.s:vue_keywords_regexp.'\s*:\s*function>/'
|
||||||
\.' containedin=jsObject,javascriptVueScript'
|
\.' containedin=jsObject,javascriptVueScript'
|
||||||
\.' skipwhite skipempty nextgroup=jsFuncArgs'
|
\.' skipwhite skipempty nextgroup=jsFuncArgs'
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user