Skip to content

Commit cfd646b

Browse files
authored
Merge pull request #22 from CodinGame/improve-html-autoclose
Fix html autoclosing
2 parents b2615a1 + 0c50778 commit cfd646b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/features/htmlContribution.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ function autoCloseHtmlTags (editor: monaco.editor.ICodeEditor): monaco.IDisposab
8686
range.endColumn + rangeLength + enclosingTag.length + 1
8787
)
8888

89+
const selections = editor.getSelections()
8990
const rest = model.getValueInRange(newRange)
90-
model.applyEdits([{
91+
editor.executeEdits('autoclosing', [{
9192
range: newRange,
9293
text: `</${enclosingTag}>${rest}`,
9394
forceMoveMarkers: true
94-
}])
95+
}], selections ?? undefined)
9596
}
9697
}, 100)
9798
}))

0 commit comments

Comments
 (0)