Skip to content

Commit

Permalink
fix: sfc block incremental offset incorrect if input at block start
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Aug 30, 2022
1 parent 018d260 commit cfcd155
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-language-core/src/plugins/file-vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const plugin: VueLanguagePlugin = () => {
const lengthDiff = change.newText.length - (change.end - change.start);

for (const block of blocks) {
if (block.loc.start.offset >= change.end) {
if (block.loc.start.offset > change.end) {
block.loc.start.offset += lengthDiff;
}
if (block.loc.end.offset >= change.end) {
Expand Down

0 comments on commit cfcd155

Please sign in to comment.