mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Simplify getting rangesToUpdate (#192079)
This commit is contained in:
parent
0c5c400ea5
commit
05673dfd1a
|
@ -25,8 +25,8 @@ export async function updateTag(tagName: string | undefined): Promise<boolean |
|
|||
return;
|
||||
}
|
||||
|
||||
const rangesToUpdate = Array.from(editor.selections).reverse()
|
||||
.reduce<TagRange[]>((prev, selection) =>
|
||||
const rangesToUpdate = editor.selections
|
||||
.reduceRight<TagRange[]>((prev, selection) =>
|
||||
prev.concat(getRangesToUpdate(document, selection, rootNode)), []);
|
||||
if (!rangesToUpdate.length) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue