-
Notifications
You must be signed in to change notification settings - Fork 68
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
Handling of invalid values in the Search, Search, Replace and Replace methods #370
Conversation
@Ekopalypse The original "request" was:
From that point I think your PR is a different approach and notifies the user about "invalid" or "problematic" input. |
Well, nobody asked me, but:
|
but the code logic is not aware of this. |
Ah, I see. |
Correct, this PR aims to prohibit empty strings as search arguments and None as search or replace arguments. |
So, my choices will be, that every search I do after this PR is integrated will need to look like: if len(find_text) == 0:
...
else:
editor.research(find_text, ...) or: try:
editor.research(...)
except:
... because we can't have the script user seeing the exception/traceback. I'm just trying to understand my options. :-) |
I don't understand the question. You can still use |
No worries; it was simply me rambling. :-)
No.
Yes. |
@Ekopalypse @alankilborn So we start to go for the exception solution until a reasonable complain is coming up. |
fixes #172
Additional methods such as
editor.replaceSel
must be handled differently, as these are automatically generated by the iface file.