Change behavior of search with vim mode enabled#51073
Change behavior of search with vim mode enabled#51073ConradIrwin merged 6 commits intozed-industries:mainfrom
Conversation
|
@viveksjain The vim mode bool makes sense to me; but what's the |
It's perhaps more accurate to call it |
|
@viveksjain can we use |
|
Ah yes you're right, somehow I didn't realize that. Thanks for the suggestion, updated! |
|
Whoops didn't mean to close |
|
Hi @ConradIrwin, please let me know if anything else is needed here! |
|
Could you please make the linter happy? |
|
I fixed the format, I'm not sure from the logs why orchestrate failed |
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.
When vim mode is enabled and search is opened via Cmd-F, the current match is now selected (and not collapsed to the first character). Closing the search bar preserves the selection and restores the prior mode (Visual for Normal/Visual, Insert for Insert).
We need to collapse matches by default in vim mode, which didn't work correctly with previous approach where vim_mode_search value is false by default and thus collapse_matches was also false. This flips the parameter to cmd_f_search, which is then false by default and it makes collapse_matches true.
|
I think I've fixed the tests now! |
|
Yo this is so much better now, thanks @viveksjain! |
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: