提交 49e570e1 编写于 作者: J jmdowns2 提交者: Ramya Rao

Fix for #32342 (#35463)

* When expanding abbreviations, do so from bottom to top.  This way a change higher up will not interfere with text below.

* When expanding abbreviations, do so from bottom to top.  This way a change higher up will not interfere with text below.
上级 fcf92f6b
......@@ -139,7 +139,14 @@ export function expandEmmetAbbreviation(args): Thenable<boolean> {
return [new vscode.Range(abbreviationRange.start.line, abbreviationRange.start.character, abbreviationRange.end.line, abbreviationRange.end.character), abbreviation, filter];
};
editor.selections.forEach(selection => {
let selectionsInReverseOrder = editor.selections.slice(0);
selectionsInReverseOrder.sort((a, b) => {
var posA = a.isReversed ? a.anchor : a.active;
var posB = b.isReversed ? b.anchor : b.active;
return posA.compareTo(posB) * -1;
});
selectionsInReverseOrder.forEach(selection => {
let position = selection.isReversed ? selection.anchor : selection.active;
let [rangeToReplace, abbreviation, filter] = getAbbreviation(editor.document, selection, position, syntax);
if (!rangeToReplace) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册