diff --git a/packages/language-core/lib/plugins/file-vue.ts b/packages/language-core/lib/plugins/file-vue.ts index e148d26d08..37d30c436d 100644 --- a/packages/language-core/lib/plugins/file-vue.ts +++ b/packages/language-core/lib/plugins/file-vue.ts @@ -45,11 +45,13 @@ const plugin: VueLanguagePlugin = ({ vueCompilerOptions }) => { + change.newText + hitBlock.content.slice(change.end - hitBlock.loc.start.offset); - // #3449 - const endTagRegex = new RegExp(``); - const insertedEndTag = endTagRegex.test(oldContent) !== endTagRegex.test(newContent); - if (insertedEndTag) { - return; + if (hitBlock.type !== "template") { + // #3449 + const endTagRegex = new RegExp(``); + const insertedEndTag = endTagRegex.test(oldContent) !== endTagRegex.test(newContent); + if (insertedEndTag) { + return; + } } const lengthDiff = change.newText.length - (change.end - change.start);