Merged
Conversation
predragnikolic
approved these changes
Apr 7, 2026
Member
Author
|
While this is obviously our bug that we trigger OnTypeFormatting in this case, I wonder whether the position we are sending to the server is actually not correct. Should we instead figure out position based on where the edit ends? Spec says: which leaves quite a bit for interpretation. |
jwortmann
approved these changes
Apr 8, 2026
Member
I think using the caret position should be appropriate. So I would maybe have used Line 789 in 93a0815 although it shouldn't make any difference because the selection region should always be empty while typing. I guess the formulation with "around" from the docstring is because the edit could change text that is not directly at the caret position (like inserting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a yaml file like:
Place cursor on the
container_nameline and move the line up (cmd+ctrl+up on Mac).Yaml server ends up adding dash where the cursor is.
Screen.Recording.2026-04-07.at.07.15.21.mov
Fix by identifying swap command as change action so the edit is not treated as type action.
Instead of explicit command name just look for
swap_lineto cater for different variants of the command including from third party packages (I'm usingSmarterLineMoveswhich overrides swap commands withsmart_*variants.