Add search_on_input setting to Project Search - #42889
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @holoflash 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'. |
|
We require contributors to sign our Contributor License Agreement, and we don't have @holoflash 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 |
|
We require contributors to sign our Contributor License Agreement, and we don't have @holoflash 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'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
We require contributors to sign our Contributor License Agreement, and we don't have @holoflash 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'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
I've been playing with this change for a little bit and I think we want to land it. Thanks for the feature and I appreciate the added test! I've got a couple of thoughts, but not all of these need to be resolved to merge the feature.
|
|
@P1n3appl3
I made it opt-in because I assume that there's a good reason for the current implementation (hitting the ENTER key), but coming from vscode, I'm used to the results showing instantly, and being able to search right in the file browser. As for the other points. I'm not really sure what the best approach might be. Maybe if something is inputed in the search field, continue the search but ONLY on the results coming from the previous query? (would need to temporarily cache the results?)
This might need a little debounce though to not trigger on each letter if typed quickly. I'll just push the version without the debounce so you can get a feel for it. |
|
I could imagine wanting this enabled sometimes (small projects) but not others (large projects with rust-analyzer regularly stressing my system). I wonder if it might be better to make this toggleable with a button next to the search bar by the filter and case sensitivity buttons instead of buried in the settings. That would also make it more discoverable. |
|
@Be-ing Screen.Recording.2025-11-22.at.10.41.35.movI just pushed the above as a suggestion. |
|
It's worth noting that the "quick search" feature in #44530 implements this functionality. I think it may still be worth doing here, but we should at least use the same logic between the impls. |
| - Setting: `search_wrap` | ||
| - Default: `true` | ||
|
|
||
| ## Center on Match |
There was a problem hiding this comment.
I noticed that there was a duplicate here so I removed it.
And I'm not quite sure what is going here with the mixed ## ###
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Thanks!
One small caveat left is the settings' documentation wording: that only toggles search on input for project search, whether the search settings it's placed into are both buffer and project searches.
But I think this is a good start already.
|
After some internal feedback, got #49150 that flipped the default back (alas) and added a debounce between strokes. I will update the PR description here accordingly, to accumulate release notes in one place. |
Follow-up of #42889 * disable by default * add a configurable debounce, 200ms default Release Notes: - N/A
|
Sorry for the bad news: turns out we'll have to revert the whole shebang of 3 related PRs for now as the feedback was "remove the flickering before having it released, even disabled"-ish. I plan to push it forward and redo the way we deal with this: the idea is to reuse search properties (it should stream files in the same order between reruns) and replace excerpts gradually, not clearing the entire thing each time, as we do now, most probably next week. |
This reverts commit fee42e1.
|
Another attempt: #49374 |
|
@SomeoneToIgnore nice!! |
Follow-up of #42889 * disable by default * add a configurable debounce, 200ms default Release Notes: - N/A
|
I was looking for this setting in Zed 0.228.0 (arch btw), but it does not seem to be included although it looks like this was merged? Also tried 0.229 preview but no dice. It is in the documentation: |
|
@krims0n32 I believe this was reverted. You should track #9318 to see when the feature lands. The |
Follow-up of zed-industries/zed#42889 * disable by default * add a configurable debounce, 200ms default Release Notes: - N/A
Deals with zed-industries/zed#9318 Re-lands zed-industries/zed#42889 with more fixes to reduce overall flickering Release Notes: - Enabled type on search by default for the project search --------- Co-authored-by: Cole Miller <cole@zed.dev>
I was really missing the ability to instantly see search results while typing in the Project Search and decided to try and implement it. As this may not be a feature that _everyone_ wants, I made it toggle-able via the settings (or the settings.json) ### Settings Set to false by default <img width="911" height="618" alt="Screenshot 2025-11-17 at 16 17 09" src="https://github.com/user-attachments/assets/8eaaab65-684e-4c5f-9a3c-9cb62cff0925" /> ### settings.json Set to false by default <img width="396" height="193" alt="Screenshot 2025-11-17 at 16 18 21" src="https://github.com/user-attachments/assets/90ebda95-c454-4bc5-8423-5da593832fd2" /> ### Video demo: https://github.com/user-attachments/assets/715d6b77-3a61-45f8-8e1a-9bd880c697c3 - Search input is debounced with 250ms in this mode (cool?) The desire for this feature has been expressed here too: zed-industries#30843 Release Notes: - Enabled project search on input. Can be turned off with `search.search_on_input` settings toggle.
Follow-up of zed-industries#42889 * disable by default * add a configurable debounce, 200ms default Release Notes: - N/A
…es#49374) Deals with zed-industries#9318 Re-lands zed-industries#42889 with more fixes to reduce overall flickering Release Notes: - Enabled type on search by default for the project search --------- Co-authored-by: Cole Miller <cole@zed.dev>
I was really missing the ability to instantly see search results while typing in the Project Search and decided to try and implement it. As this may not be a feature that _everyone_ wants, I made it toggle-able via the settings (or the settings.json) ### Settings Set to false by default <img width="911" height="618" alt="Screenshot 2025-11-17 at 16 17 09" src="https://github.com/user-attachments/assets/8eaaab65-684e-4c5f-9a3c-9cb62cff0925" /> ### settings.json Set to false by default <img width="396" height="193" alt="Screenshot 2025-11-17 at 16 18 21" src="https://github.com/user-attachments/assets/90ebda95-c454-4bc5-8423-5da593832fd2" /> ### Video demo: https://github.com/user-attachments/assets/715d6b77-3a61-45f8-8e1a-9bd880c697c3 - Search input is debounced with 250ms in this mode (cool?) The desire for this feature has been expressed here too: zed-industries#30843 Release Notes: - Enabled project search on input. Can be turned off with `search.search_on_input` settings toggle.
I was really missing the ability to instantly see search results while typing in the Project Search and decided to try and implement it.
As this may not be a feature that everyone wants, I made it toggle-able via the settings (or the settings.json)
Settings
Set to false by default

settings.json
Set to false by default

Video demo:
search_on_input_demo.mov
The desire for this feature has been expressed here too: #30843
Release Notes:
search.search_on_inputsettings, and debounced withsearch.search_on_input_debounce_ms(200ms default)