Skip to content

Commit 5be56a4

Browse files
authored
fix html tag auto close (#79)
1 parent bbb894e commit 5be56a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/svelte-vscode/src/html/autoClose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function activateTagClosing(
6767
}
6868
const lastChange = changes[changes.length - 1];
6969
const lastCharacter = lastChange.text[lastChange.text.length - 1];
70-
if ("range" in lastChange && lastChange.range.start !== lastChange.range.end || (lastCharacter !== '>' && lastCharacter !== '/')) {
70+
if ("range" in lastChange && (lastChange.rangeLength ?? 0) > 0 || (lastCharacter !== '>' && lastCharacter !== '/')) {
7171
return;
7272
}
7373
const rangeStart = "range" in lastChange ? lastChange.range.start : new Position(0, document.getText().length);

0 commit comments

Comments
 (0)