Fix undefined a:block in indent

s:AdjustBlockIndent() had `let block = a:block` without such an argument,
so GetVueIndent() hit E121 for every line in template, script and style.
It was hidden as errors in 'indentexpr' are silent and the function goes
on, but showed up when calling GetVueIndent() directly.

Also return [0, 0] in s:PrevMultilineEmptyTag() when no tag start is
found, instead of no value.

Add ExpectIndentEachLine() for tests to call GetVueIndent() for each
line and check the result.
This commit is contained in:
leafOfTree committed 2026-10-21 12:11:30 +00:00
1 parent ee1a608c40
commit acdcadc39b
4 files changed
+49 -1

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
" GetVueIndent() for each line without errors
let g:test_flatten = 1
function! Check()
call ExpectIndentEachLine()
endfunction
+24
View File
@@ -0,0 +1,24 @@
<template>
<div
class="a"
>
<input
type="text"
>
<p :class="{ a: b }">x</p>
</div>
</template>
<script>
export default {
data() {
return { a: 1 }
},
}
</script>
<style>
p {
color: red;
}
</style>