# text_finder: Seed query from focused item selection, including terminal \(\#60351\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e8edc63761f4181093c37f0ba3604212bb49d69f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e8edc63761f4181093c37f0ba3604212bb49d69f

Requested commit: e8edc63761f4181093c37f0ba3604212bb49d69f

Commit: e8edc63761f4181093c37f0ba3604212bb49d69f

Tree: d52fdea31efc2d0a81a73fa6c0d2843b18f42ee4

Author: ozacod

Committer: GitHub

## Message

```
text_finder: Seed query from focused item selection, including terminal (#60351)

## Summary
Seed the text_finder's query from the focused pane's item instead of
only the active center editor. Selecting text in the terminal or
markdown_preview and opening text_finder now seeds that selection; the
item next to focus wins when both it and a center editor have
selections. If the focused item has no selection, the center item is
tried, then the last persisted search as before.

## Test plan
- Select a word in the terminal, open Text Finder, confirm it's
pre-filled and searching
- With a selection in both terminal and editor, confirm the focused one
wins
- Focus the terminal without a selection, confirm an editor selection
still seeds
- No selection anywhere, confirm the last search is restored
- Confirm a selection in a markdown preview seeds too

Release Notes:

- Improved the Text Finder to seed its query from the focused item's
selection, including the terminal

---------

Co-authored-by: ozacod <ozacod@users.noreply.github.com>
```

## Parents

- [8f6f8a54b9933059f1963af601369e0555e32649](https://git.cafe/gitcafe/zed/commit/8f6f8a54b9933059f1963af601369e0555e32649?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e8edc63761f4181093c37f0ba3604212bb49d69f?format=markdown)
