Add optional relative line jumps to go-to-line action#46932
Add optional relative line jumps to go-to-line action#46932ConradIrwin merged 2 commits intozed-industries:mainfrom
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @KalaayPT 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'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
but there are release notes? |
|
It's very picky about formatting! Does this need to be an option, or could we have |
i would actually prefer it be an option because i would prefer not to have to type '+' every time. i already added 'b' as an alternative to '-' because its closer to the home row and you dont have to stretch as much, same for '+' also added a newline after release notes in case that was the issue |
|
For that use-case you can bind Actually, thinking about this more, did you know that |
yeah but thats in vim mode, this is specifically for usage outside of vim mode |
|
Makes sense. Ok, let's ship the version of this without the option. People who want to default to relative jump in the forward direction can add a mapping that uses workspace::SendKeystrokes; and we can make sure that the parser handles +- by taking the last direction (i.e. I'm ok with having (I also want to at some point significantly improve the UX of workspace::SendKeystrokes by giving it its own JSON syntax, but haven't done that yet) |
|
am a little bit confused on the implementation youre proposing. would that essentially mean "if the user inputs multiple 'directions' we only take the last one"? just to accomodate the keybind you were proposing? |
|
I prefer it because it reduces the number of different states we have to maintain (the palette always works the same regardless of how you open it). |
|
updated to implement what we discussed. + and - are now built into go-to-line directly and support +/-/f/b/F/B. also only takes the last direction so "+b2" still jumps backwards, accounting for custom keybinds inserting a '+'. should i update the description? or only release notes? |
|
Thanks for the update, and sorry for not hitting merge sooner. |
Key changes: - Reopen with encoding (zed-industries#46553) - new encoding selector with reopen support - Relative line jumps in go-to-line (zed-industries#46932) - Terminal tab renaming (zed-industries#45800) - Project search spinner while search underway (zed-industries#47620) - Git: retain "since" diffs, avoid unwrap in panel, don't rebuild diff on repo change - Extensions: fix duplicate button IDs preventing uninstall (zed-industries#47745) - SendKeystrokes: don't use layout key equivalents (zed-industries#47061) - Collab tests extracted to integration crate (deleted in our fork) - Various CI, docs, and agent improvements Conflict resolutions: - Kept native_button style, adopted extension_button_id() for unique IDs - Added encoding_selector::init alongside browser::init - Fixed _cx → cx rename for new encoding selector render code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements relative line jumping, a common feature i missed from Vim/Neovim where you can jump to lines relative to your current cursor position.
{"relative": true}flag forgo_to_line::Toggleaction-5(5 lines up) andb5(backward 5 lines) syntax"ctrl-j": ["go_to_line::Toggle", {"relative": true}]to their keymapExample usage:
5→ jump 5 lines down-3orb3→ jump 3 lines up0→ stay on current lineScreencast_20260115_191312.webm
Release Notes:
+/-/f/b/F/B