-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
TouchMenu: menu search without patterns #9884
Conversation
frontend/ui/widget/touchmenu.lua
Outdated
local status, err = pcall( function() ("test_string"):find(search_for) end) | ||
local status, err = pcall( function() ("test_string"):find(search_for, 1, true) end) | ||
if status then | ||
search_for = Utf8Proc.lowercase(search_for) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this pcall was actually to test that the input string, if it is a Lua pattern, is a valid pattern, and show "Malformed message" if it is not (if Lua :find() fails using it).
If we don't do pattern find, no need for the pcall
and the else
branch, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
else | ||
err = err:sub(err:find("lua") + 10) -- 10 = strlen("lua:1165: ") | ||
UIManager:show(InfoMessage:new{ | ||
text = T(_("Malformed message:\n%1"), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I'd overlooked this one; hopefully the translators haven't noticed it yet. :-)
See #9876 (comment).
This change is