Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select all matches #2717

Merged
merged 6 commits into from
Jul 14, 2023
Merged

Select all matches #2717

merged 6 commits into from
Jul 14, 2023

Conversation

SomeoneToIgnore
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore commented Jul 13, 2023

Closes #6208

The PR

  • changes keybindings for Editor && mode == auto_height context: before, alt-enter and alt-shift-enter added new lines in such editors, including the one from buffer search.

New bindings are the same as in Editor && mode == full context.

  • adds search::SelectAllMatches action and binds it to Alt + Enter by default, to select all matches of a buffer search

The behavior mimics VSCode: we do not move the screen even if all selections are out of the visible range (Cmd+G will navigate there) and allow reselecting the results from both pane and search field, as long as the search is not dismissed.

Release Notes:

  • Added search::SelectAllMatches (Alt + Enter default) action to place carets and select all buffer search results (#1749).

@iamnbutler
Copy link
Member

This is awesome! Could we add a UI button to search either in this PR or a follow up PR?

@SomeoneToIgnore
Copy link
Contributor Author

Sure thing!

For now, I did not add any since VSCode did not have that, but no strong opinions.
I am still trying to fix another thing related to the feature: our match counter relies on selections, so it is always n/n items when user presses alt + enter in Zed — while VSCode remembers previous match number and cmd + g shortcuts work better.

@SomeoneToIgnore SomeoneToIgnore merged commit cde5b39 into main Jul 14, 2023
@SomeoneToIgnore SomeoneToIgnore deleted the kb/select-all-matches branch July 14, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Select all instances for search (Like Sublime's Find All)
2 participants