## Summary It is incremental step to solve issue #59825. This PR addresses the need for facilitating quick edits for matches obtained by ‘text_finder’. This makes the text finder remember the last query, so you can jump to a match, make a quick edit, and reopen the finder to the same results instead of typing the same query again. ## Problem A common flow is, open the text editor, then jump to first match, edit that file, then reopen the finder to continue for next matches. But on the reopen, the query was seeded from under the cursor. And after editing, the cursor is usually sitting on an unrelated word, and previous search was lost. The root cause is priority, the word under the cursor was seeding the query. ## Solution Reorder query seeding so last query outranks the cursor word, then cursor word can be dropped entirely, since last query is prioritized over the word under cursor, the last query always wins, so checking the cursor word afterwards is dead code. And JetBrains makes the same choice, entirely ignores word on the cursor for seeding query. Explicit selection still outranks the last query, since selecting text is usually a deliberate choice. ### Before 1- Active project search query (if any) 2- Active buffer search query (if any) 3- Selected text or word under the cursor 4- Empty ### After 1- Active project search query (if any) 2- Active buffer search query (if any) 3- Selected text 4- Last query (of this project) 5- Empty With updated order, this friction disappears (the same order is also observed in JetBrains). To make the last query persistent, it is stored per project in the database along with the active filters (case sensitive, whole word, regex), so they also survive reopening the project. ## Testing - Manually verified the seed priority order between the options. - Verified the last query is seeded when project is reopened. - Verified filters are restored regardless of this query order. Release Notes: - Improved the text finder to seed the last query and filters to make quick edits easier. --------- Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Yara 🏳️⚧️ <git@yara.blue>
3 files changedLine totals unavailable