mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-11-01 10:06:24 +08:00
test / test (push) Canceled after 0s
Add cases for attribute highlight on and off, block syntax by lang and emmet-vim group names, OnChangeVueSyntax(), matchit, .wpy, initial_indent as syntax and tag.syntax, and syntax after reloading. Also check indenting a file after removing all indent with g:test_flatten, which fails before the end tag fix as closing tags at column 0 were taken as block end tags.
28 lines
779 B
VimL
28 lines
779 B
VimL
" OnChangeVueSyntax() is called when syntax under cursor changes. It's
|
|
" defined before the plugin is loaded
|
|
let g:vim_vue_plugin_config = {
|
|
\'syntax': {
|
|
\ 'template': ['html'],
|
|
\ 'script': ['javascript', 'typescript'],
|
|
\ 'style': ['css', 'scss'],
|
|
\},
|
|
\}
|
|
let g:test_changes = []
|
|
|
|
function! OnChangeVueSyntax(syntax)
|
|
call add(g:test_changes, a:syntax)
|
|
endfunction
|
|
|
|
function! Check()
|
|
for lnum in [2, 3, 6, 6, 10, 2]
|
|
call cursor(lnum, 1)
|
|
doautocmd CursorMoved
|
|
endfor
|
|
call ExpectEqual(g:test_changes, ['html', 'typescript', 'scss', 'html'],
|
|
\ 'syntax changes')
|
|
call ExpectEqual(GetVueSyntax(), 'html', 'GetVueSyntax()')
|
|
call ExpectTag(6, 'script')
|
|
call ExpectTag(10, 'style')
|
|
endfunction
|
|
let g:test_flatten = 1
|