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

Persist current search term until intentionally changed #1509

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Jan 16, 2025

Fixes #1508

In master as soon as you edit a document in a way that results in a "selection_changed" signal being emitted (e.g. copy, cut , paste, select etc) the current search term is immediately lost so has to be re-entered to search for the next occurrence, which is most annoying.

This PR results in the search term persisting until a new search is intentionally started by pressing Control + F or by editing the search bar. Making a new selection in the document no longer replaces the search term in the searchbar until Control + F is pressed again (Control + G continues to search the current search term).

The search term is cleared when the searchbar is hidden.

The code is somewhat simpler and DRYer.

The searchbar is made more self-contained - it now includes the revealer and hides some of its internal working from MainWindow. Some names are made more accurately descriptive of what they are/do.

@jeremypw jeremypw marked this pull request as draft January 24, 2025 16:55
@jeremypw
Copy link
Collaborator Author

Reverting to draft after some issues came to light while dog-fooding

@jeremypw jeremypw marked this pull request as ready for review January 25, 2025 18:31
@jeremypw
Copy link
Collaborator Author

Outstanding issues should be fixed now.

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.

Search term disappears unexpectedly when editing text
1 participant