mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
* 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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user