text_finder: Seed text finder query from active project and buffer search - #59779
Merged
Merged
Conversation
When opening the text finder (text_finder::Toggle), pre-populate its query the same way project search already seeds itself. seed_query now tries, in priority order: the active project search's query, then a focused buffer search bar's query (reusing project search's buffer_search_query helper, promoted to pub(crate)), then the word under the cursor.
ozacod
marked this pull request as ready for review
June 23, 2026 18:21
yara-blue
enabled auto-merge
June 24, 2026 10:13
Contributor
|
Again thank you so much for helping out with these! I planning to make a list of all the things we wanted to add but could not find the time for. Want me to tag you in that? |
11 tasks
yara-blue
force-pushed
the
feat/buffer-to-textfinder
branch
from
June 24, 2026 13:06
1a2dd5d to
ea315d2
Compare
Contributor
Author
Yes, I would be glad to help out |
weihuoya
pushed a commit
to weihuoya/zed
that referenced
this pull request
Jun 25, 2026
…arch (zed-industries#59779) ## Summary When opening the text finder (`text_finder::Toggle`), pre-populate its query the same way project search already seeds itself. Previously `seed_query` only asked the active editor for the word under the cursor, so opening the text finder from a project search tab or a focused buffer search bar started empty. `seed_query` now tries these sources in priority order: 1. **Active project search** — its current query (`ProjectSearchView::search_query_text`). 2. **Focused buffer search bar** — its query, reusing project search's existing `buffer_search_query` helper (promoted from private to `pub(crate)` so there's one source of truth rather than a copy). 3. **Word under the cursor** — the existing `query_suggestion` fallback, still honoring the `seed_search_query_from_cursor` setting. This mirrors how project search is fed from the buffer search bar (`existing_or_new_search`), keeping the seeding behavior consistent across the three search surfaces. ## Testing - Manual: open project search with a query → toggle text finder → query carries over; cmd+f with a query focused → toggle text finder → query carries over; otherwise the word under the cursor seeds it as before. Release Notes: - Improved text finder to pre-fill its query from the active project search or buffer search --------- Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Yara 🏳️⚧️ <git@yara.blue>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…arch (zed-industries#59779) ## Summary When opening the text finder (`text_finder::Toggle`), pre-populate its query the same way project search already seeds itself. Previously `seed_query` only asked the active editor for the word under the cursor, so opening the text finder from a project search tab or a focused buffer search bar started empty. `seed_query` now tries these sources in priority order: 1. **Active project search** — its current query (`ProjectSearchView::search_query_text`). 2. **Focused buffer search bar** — its query, reusing project search's existing `buffer_search_query` helper (promoted from private to `pub(crate)` so there's one source of truth rather than a copy). 3. **Word under the cursor** — the existing `query_suggestion` fallback, still honoring the `seed_search_query_from_cursor` setting. This mirrors how project search is fed from the buffer search bar (`existing_or_new_search`), keeping the seeding behavior consistent across the three search surfaces. ## Testing - Manual: open project search with a query → toggle text finder → query carries over; cmd+f with a query focused → toggle text finder → query carries over; otherwise the word under the cursor seeds it as before. Release Notes: - Improved text finder to pre-fill its query from the active project search or buffer search --------- Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Yara 🏳️⚧️ <git@yara.blue>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When opening the text finder (
text_finder::Toggle), pre-populate its query the same way project search already seeds itself. Previouslyseed_queryonly asked the active editor for the word under the cursor, so opening the text finder from a project search tab or a focused buffer search bar started empty.seed_querynow tries these sources in priority order:ProjectSearchView::search_query_text).buffer_search_queryhelper (promoted from private topub(crate)so there's one source of truth rather than a copy).query_suggestionfallback, still honoring theseed_search_query_from_cursorsetting.This mirrors how project search is fed from the buffer search bar (
existing_or_new_search), keeping the seeding behavior consistent across the three search surfaces.Testing
Release Notes: