Skip to content

Implement Search - #50

Merged
wpkelso merged 19 commits into
wpkelso:mainfrom
teamcons:search_button
Jul 13, 2026
Merged

Implement Search#50
wpkelso merged 19 commits into
wpkelso:mainfrom
teamcons:search_button

Conversation

@teamcons

@teamcons teamcons commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

fix #39
requires #52

The search is very crashy, though it correctly finds a few words... if you copy paste them.
I am still working on this. But the UI part fully works so you can already get an idea

If you plan a toolbar, i can move the content of the revealer into a neat little popover though

@teamcons

Copy link
Copy Markdown
Contributor Author

Okay search fields have been moved from a revealer to a popover
The popover version leaves the space for a toolbar, but i feel like having the search not be a menu but always-there is more comfortable
moving the whole textview to reveal a bar feels overkill

The search now works semi-ok, and there is a smooth scrolling to go to the found term

the big blocker i now have is that TextIter is not supposed to crash if it rewinds/search too far/doesnt find anything. It is supposed to return a False.

@teamcons

Copy link
Copy Markdown
Contributor Author

Okay

-At current, the search always starts from the end. I will get around to fix this but havent found yet

-because of TextIter search methods apparently crashing instead of returning a boolean, search relies on a very dirty workaround to ensure search without crash. If someone opens huge text files they will notice (the method scans at worst the whole buffer three times for one term search)

@teamcons

teamcons commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

Okay

@wpkelso Could you please try it out and let me know what you think, if that is ok with you?
(no pressure though :) )

Because of a bug that forces me to do an ugly workaround to avoid a crash, it is not "optimal", but a search through 10 times the whole Martin Luther King speech has no sign of slowing the UI down.

@teamcons
teamcons marked this pull request as ready for review February 17, 2026 18:29

@wpkelso wpkelso left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry for forgetting about this, it all looks ok to me. I think we should be ok despite the slow-down on large files; if the slow-down become a noticeable issue for users I think we can deal with it then.

@wpkelso
wpkelso merged commit 6a8af03 into wpkelso:main Jul 13, 2026
3 checks passed
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.

Add find bar

2 participants