Files
vim-vue-plugin/test/cases/lang-attr.vim
T
leafOfTree 063231ca9e Allow lang without quotes and lang="typescript"
<script lang=ts> and <style lang=sass> without quotes weren't
recognized, so they used the first syntax in the config. For sass, it
also flattened the nesting when indenting. lang="typescript" wasn't
recognized either.

Languages not in the config still use the first syntax as before.
2026-10-21 12:13:24 +00:00

18 lines
652 B
VimL

" lang in double or single quotes or without quotes, and
" lang="typescript"
let g:vim_vue_plugin_config = {
\'syntax': {
\ 'template': ['html'],
\ 'script': ['javascript', 'typescript'],
\ 'style': ['css', 'scss', 'sass'],
\},
\}
function! Check()
call ExpectEqual(GetVueSyntax(), 'html', 'syntax at line 1')
call ExpectBlock('let a', 'script', 'typescript', 'typescriptScriptBlock')
call ExpectBlock('let b', 'script', 'typescript', 'typescriptScriptBlock')
call ExpectBlock('$c', 'style', 'scss', 'cssScssStyleBlock')
call ExpectBlock('color: red', 'style', 'sass', 'sassStyleBlock')
endfunction