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

Return early from various search functions when the target is empty #200

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

patch0
Copy link
Contributor

@patch0 patch0 commented Mar 13, 2025

I noticed that if I went into a search/replace dialog Ox would freeze if I tried to find all instances of an empty string.

This PR checks to see if the string given in both the search prompt, the replace prompt, and next_match/prev_match is empty. If so, return from the current function early.

This is my first time writing Rust 😅 and I've not written any tests..!

I noticed that if I went into a search/replace dialog Ox would freeze if
I tried to find all instances of an empty string.  This PR checks to see
if the string given in both the search prompt, the replace prompt, and
next_match/prev_match is empty.  If so, return from the current function
early.
@curlpipe
Copy link
Owner

Thank you for the contribution! Glad to see the search / replace is more robust now.

@curlpipe curlpipe merged commit cfb43ac into curlpipe:master Mar 13, 2025
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.

None yet

2 participants