Skip to content

Update OneSnippet#move method to fix #96545.#108964

Merged
jrieken merged 1 commit intomicrosoft:masterfrom
turara:fix-96545
Nov 4, 2020
Merged

Update OneSnippet#move method to fix #96545.#108964
jrieken merged 1 commit intomicrosoft:masterfrom
turara:fix-96545

Conversation

@turara
Copy link
Contributor

@turara turara commented Oct 20, 2020

This PR fixes #96545.

I have changed EditOperation.replaceMove to EditOperation.replace in OneSnippet#move method and added a unit test.

Although all the unit tests are passed, I'm not 100% sure about side effects. I would appreciate feedbacks!

@jrieken
Copy link
Member

jrieken commented Oct 27, 2020

I don't think this is the right fix (and btw a risky change). Also, you unit test doesn't use the snippet supplied in the issue.

@turara
Copy link
Contributor Author

turara commented Oct 27, 2020

Thank you for your comment! I see. Should I close this PR?

What I was able to find about the cause of the issue was that the cursor moves forward when the second placeholder is done. And yes, I had a feeling that this change might be risky... 😓

About the unit test, I thought the snippets are equivalent. (If you use the one in the issue, the test case is also passed.)

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.

Actually, this is a good change... Only had the time now to properly look into this. Yeah, the challenge is moving placeholder while inserting the snippet. The OP used this snippet ${1:{}${2:fff}${1/[\\{]/}/} which slightly differs but it will work your change as well. Thanks

@jrieken jrieken merged commit 4b9e0bb into microsoft:master Nov 4, 2020
@jrieken jrieken added this to the November 2020 milestone Nov 4, 2020
@turara
Copy link
Contributor Author

turara commented Nov 4, 2020

@jrieken Thanks for your time! 😃

@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snippet tab stop selection issue

2 participants