Skip to content

Fix for #32342#35463

Merged
ramya-rao-a merged 2 commits intomicrosoft:masterfrom
jmdowns2:32342
Oct 12, 2017
Merged

Fix for #32342#35463
ramya-rao-a merged 2 commits intomicrosoft:masterfrom
jmdowns2:32342

Conversation

@jmdowns2
Copy link
Contributor

@jmdowns2 jmdowns2 commented Oct 1, 2017

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

…ange higher up will not interfere with text below.
editor.selections.forEach(selection => {
let selectionsInReverseOrder = editor.selections.slice(0);
selectionsInReverseOrder.sort((a, b) => {
return a.anchor.compareTo(b.anchor) * -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What we should compare here is the ending position of the abbreviation

anchor comes after active when selection.isReversed is true.

So instead of a.anchor.compareTo(b.anchor), this should probably be
(a.isReversed ? a.anchor: a:active).compareTo(b.isReversed ? b.anchor: b:active) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…ange higher up will not interfere with text below.
@ramya-rao-a
Copy link
Contributor

Thanks @jmdowns2!

@ramya-rao-a ramya-rao-a merged commit 49e570e into microsoft:master Oct 12, 2017
sandy081 pushed a commit that referenced this pull request Oct 16, 2017
* 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.
@ramya-rao-a ramya-rao-a added this to the October 2017 milestone Nov 7, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants