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

TouchMenu: menu search without patterns #9884

Merged
merged 2 commits into from
Dec 7, 2022
Merged

Conversation

Frenzie
Copy link
Member

@Frenzie Frenzie commented Dec 7, 2022

See #9876 (comment).


This change is Reviewable

@Frenzie Frenzie added this to the 2022.12 milestone Dec 7, 2022
Comment on lines 1322 to 1324
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)
Copy link
Contributor

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 ?

Copy link
Member Author

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)
Copy link
Member Author

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. :-)

@Frenzie Frenzie merged commit e026598 into koreader:master Dec 7, 2022
@Frenzie Frenzie deleted the menu-search branch December 7, 2022 17:41
Frenzie added a commit to Frenzie/koreader that referenced this pull request Dec 7, 2022
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