Skip to content

Fix snippet overtyping feature#165871

Merged
jrieken merged 3 commits intomicrosoft:mainfrom
n-gist:broken-snippet-overtyping-fix
Nov 15, 2022
Merged

Fix snippet overtyping feature#165871
jrieken merged 3 commits intomicrosoft:mainfrom
n-gist:broken-snippet-overtyping-fix

Conversation

@n-gist
Copy link
Contributor

@n-gist n-gist commented Nov 8, 2022

Fix snippet overtyping feature #105440 which stopped working during 1.72 ... 1.73 due to 1e662b0

@n-gist
Copy link
Contributor Author

n-gist commented Nov 8, 2022

@jrieken, I just moved model cancellation call a line later because, if I'm right, the feature gets the selected text from the model, so it must exist at the time of insertion, but perhaps a better solution is needed

@n-gist n-gist marked this pull request as ready for review November 8, 2022 22:39
});

// cancel -> stops all listening and closes widget
this.model.cancel();
Copy link
Member

Choose a reason for hiding this comment

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

The cancelling must happen before calling insert. It needs a different change which freezes the overtyping capturer before that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted.
Changed logic of emptying captured selections and added locking while suggestions widget is active.
This should also fix some non-critical cases when it returned previously saved selection when there were no selection at widget trigger time.

@n-gist n-gist requested a review from jrieken November 9, 2022 20:03
Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

lgtm

@jrieken jrieken added this to the November 2022 milestone Nov 15, 2022
@jrieken
Copy link
Member

jrieken commented Nov 15, 2022

Thanks @n-gist

@jrieken jrieken merged commit aadbe18 into microsoft:main Nov 15, 2022
@Walker-Xin
Copy link

The issue came back after 17.4.2 update.

@n-gist
Copy link
Contributor Author

n-gist commented Dec 21, 2022

The issue came back after 17.4.2 update.

1.74.2 working as expected for me

@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2022
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.

4 participants