editor: Limit CopyHighlightJson to selection#46555
Merged
SomeoneToIgnore merged 6 commits intozed-industries:mainfrom Mar 31, 2026
Merged
editor: Limit CopyHighlightJson to selection#46555SomeoneToIgnore merged 6 commits intozed-industries:mainfrom
CopyHighlightJson to selection#46555SomeoneToIgnore merged 6 commits intozed-industries:mainfrom
Conversation
Contributor
e7b066d to
8d05f4d
Compare
8d05f4d to
7fd0ea0
Compare
7fd0ea0 to
defd403
Compare
Contributor
|
Passing by and noticing that this lacks any testing at all which most probably does not help to get this reviewed. |
CopyHighlightJson to selection
The final line of selection wasn't always included, depending how chunks were laid out. We just needed to push a final line if any of its chunks are non-empty.
Contributor
Author
Good point, it took me a while to figure out the best way to write tests against this feature but I think what I've got now should help! |
Contributor
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Thank you, looks really nice overall, one small thing to clear and we're ready to merge.
SomeoneToIgnore
approved these changes
Mar 31, 2026
Contributor
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Nice, thank you for the simplification!
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.
Closes #36618
I'm not sure if there is a specific issue for this, but I noticed it while working on some other PRs, as have some other people: #20525 (comment)
Cause: when running
copy highlight JSONfrom the command palette, input was disabled due to the modal, and the selection method call always returnsNone. This most likely works as expected when bound to a keyboard shortcut, but since there is no default shortcut most people probably don't execute this action that way.Fix: just grab the selection directly; I don't think this command needs to be IME-aware, so it doesn't need to use
selected_text_range.NOTE: There still seems to be an issue where
VISUAL LINEmode doesn't select anything, even when I calledselections.newest_adjusted, so I opted to try and keep the implementation closest to what it was doing before. (edit: actually this might just be the same as #45799?).Release Notes:
editor: copy highlight JSONnot limiting to the current selection