Change behavior of search with vim mode enabled#35157
Change behavior of search with vim mode enabled#35157viveksjain wants to merge 2 commits intozed-industries:mainfrom
Conversation
Fixes zed-industries#7692. When vim mode is enabled, previously if `Cmd-F` (or platform equivalent) was pressed, enter will go to the editor's first match, and then hitting enter again goes to the next line rather than next match. This PR changes it to make enter go to the next match, which matches the convention in most other programs. The behavior when search is initiated with `/` is left unchanged.
|
We require contributors to sign our Contributor License Agreement, and we don't have @viveksjain 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'. |
|
One thing I couldn't figure out is how is the rendering of search matches done in vim mode. In non-vim mode, it highlights the current match, but in vim mode even after this change, it only highlights the current line, but not the match within the line. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@viveksjain In non-vim mode the selection is updated immediately as you type in the buffer, so the current result is selected, in vim mode this is not done. I think we should probably also make that conditional, as it's pretty broken feeling when you can't see the current result right now. |
|
Closing for now, but feel free to re-open if you get time to work on this more |
|
Hi @ConradIrwin I don't think I have permission to reopen this PR so I created a new one at #51073, thanks! Every time I decide to take zed for another spin I get bothered by this issue :) |
When vim mode is enabled, previously if Cmd-F (or platform equivalent) was pressed, enter will go to the editor's first match, and then hitting enter again goes to the next line rather than next match. This PR changes it to make enter go to the next match, which matches the convention in most other programs. The behavior when search is initiated with / is left unchanged. This is a reopen of #35157, rebased and fixed. Closes #7692 Release Notes: - In vim mode, when search is triggered by the non-vim mode shortcut (cmd-f by default) enter will now behave as it does outside of vim mode. --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
When vim mode is enabled, previously if
Cmd-F(or platform equivalent) was pressed, enter will go to the editor's first match, and then hitting enter again goes to the next line rather than next match. This PR changes it to make enter go to the next match, which matches the convention in most other programs. The behavior when search is initiated with/is left unchanged.Closes #7692
Release Notes:
/and instead a keyboard shortcut, hitting enter goes to the next match