editor: Add select to {start,end} of larger syntax node commands#47571
Merged
smitbarmase merged 1 commit intozed-industries:mainfrom Jan 28, 2026
Merged
Conversation
To accompany the move-to versions
|
We require contributors to sign our Contributor License Agreement, and we don't have @alexispurslane on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
Contributor
Author
|
|
Contributor
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Contributor
Author
Would y'all be open to a few more editing commands from Emacs that I miss? |
Member
|
Can't promise anything, but feel free to open a discussion with the commands you have in mind and tag me. That way we can chat before you start implementing. General rule: if it's something a modern editor should have and the implementation is short and self-contained, it's likely to be accepted. |
6 tasks
naaiyy
added a commit
to Glass-HQ/Glass
that referenced
this pull request
Feb 16, 2026
Key changes: - Version bump v0.223 - Bold folder labels setting (zed-industries#47631) for project panel - min_size/max_size style methods in GPUI (zed-industries#47775) - Emoji typing fix (zed-industries#47835) - Heap allocation reductions in GPUI (zed-industries#47858) - Git graph: feature graph support (zed-industries#47861) - Editor: select to start/end of larger syntax node (zed-industries#47571) - Scroll position persistence moved to background with debounce (zed-industries#47834) - Markdown: improved double-click word selection (zed-industries#47844) - Language injections fix (zed-industries#46134) - SharedString::new_static for string literals (zed-industries#47865) - ACP registry improvements and agent deprecation banners Conflict resolutions: - Kept our version (0.0.1), not upstream's 0.223.0 - Removed vim settings from default.json, settings_content, settings_ui - Took upstream's bold_folder_labels in project panel - Removed deleted crate files (gpui, vim, util) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
I'm used to having the Emacs mark-sexp command, which selects/extends the selection to the start or end of a sexp/larger syntax node, so when I found out the
move to {start,end} of larger syntax nodecommands were added, these seemed like a natural addition; especially since most other commands in Zed seem to have movement and selection pairs, but those didn't really feel like they did.I did a really lot of tests (brainstormed ideas with GLM 4.7, then wrote the actual test case strings myself, then had it convert them to Rust, then made sure the tests made sense and passed), I'm not sure if it's too much or too little, but I looked at the PR that added the
move toversions of these commands and it was also +~550 lines, so this seemed in the ballpark 😅I factored out the core syntax node finding logic from those commands into a common function, so that both sets of commands could use it, just with different code for modifying the editor state wrapped around — mine just moves each selection's head, instead of totally resetting it.
Release Notes:
editor: select to start of larger syntax nodeandeditor: select to end of larger syntax node.