mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-11-01 18:12:19 +08:00
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.
This commit is contained in:
4 files changed
+42
-3
No files matched your search
@@ -0,0 +1,17 @@
|
||||
" 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
|
||||
@@ -0,0 +1,20 @@
|
||||
<template lang=html>
|
||||
<div>x</div>
|
||||
</template>
|
||||
|
||||
<script lang=ts>
|
||||
let a: number = 1
|
||||
</script>
|
||||
|
||||
<script lang="typescript">
|
||||
let b: number = 2
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
$c: 1px;
|
||||
</style>
|
||||
|
||||
<style lang=sass>
|
||||
p
|
||||
color: red
|
||||
</style>
|
||||
Reference in new issue
Block a user