New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
insertSnippet can put snippet selections in wrong positions #145727
Comments
I can reproduce but don't know yet what's happening... |
This happens because there is an indent only line. Somehow, it is being cleared when/while the snippet edit is being made. That invalidates the offset we have cached at the start of the snippet session. The four whitespace characters that are being removed are exactly those four character by which the placeholders are shifting. From the recording you can see that this only happens when the indentation is cleaned-up (line 4) while the snippet is being inserted. Screen.Recording.2022-03-25.at.17.12.27.mov |
/cc @alexdima let's discuss Monday. It seems that I am suffering from some auto-clean on edit behaviour here |
…do edits to initialize the offset for snippets Co-authored-by: Johannes <johannes.rieken@gmail.com>
Nice, will test it when I get my hands on it. |
It works fine on my end now @jrieken 👍 |
/verified |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
I created a new extension to test this where I basically use a keybinding to trigger a command inserting a snippet.
Speed is of the essence in a lightweight environment/extension in order to reproduce this so that's why we need the keybinding.
in a new file containing
putting the cursor after the first "text", pressing enter twice quickly followed by crtl+m puts the snippet cursors on "ean> = " and "ean>();" instead of "boolean" and "boolean"
The text was updated successfully, but these errors were encountered: