mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-09 22:25:12 +08:00
feat: add debug toggle variable
This commit is contained in:
@@ -22,10 +22,12 @@ Support `.wpy` files too.
|
|||||||
|
|
||||||
Set global variable to `1` to enable or `0` to disable.
|
Set global variable to `1` to enable or `0` to disable.
|
||||||
|
|
||||||
`g:vim_vue_plugin_has_init_indent`: indent one tab inside `sytle/template/script` tags (default: 0 for .vue and 1 for .wpy)
|
`g:vim_vue_plugin_has_init_indent`: initially indent one tab inside `style/script` tags. (default: 0 for `.vue` and 1 for `.wpy`)
|
||||||
|
|
||||||
let g:vim_vue_plugin_has_init_indent = 1
|
let g:vim_vue_plugin_has_init_indent = 1
|
||||||
|
|
||||||
|
`g: vim_vue_plugin_debug`: echo debug message in `messages` list. Useful to debug if indent errors occur.
|
||||||
|
|
||||||
## Screenshot
|
## Screenshot
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -13,7 +13,7 @@ endif
|
|||||||
se sw=2 ts=2
|
se sw=2 ts=2
|
||||||
|
|
||||||
let s:name = 'vim-vue-plugin'
|
let s:name = 'vim-vue-plugin'
|
||||||
let s:__DEBUG__ = 1
|
|
||||||
" Save the current JavaScript indentexpr.
|
" Save the current JavaScript indentexpr.
|
||||||
let b:vue_js_indentexpr = &indentexpr
|
let b:vue_js_indentexpr = &indentexpr
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ function! GetVueIndent()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LogMsg(msg)
|
function! LogMsg(msg)
|
||||||
if s:__DEBUG__
|
if g:vim_vue_plugin_debug
|
||||||
echom '['.s:name.'] '. a:msg
|
echom '['.s:name.'] '. a:msg
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user