mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix early unhighlight after Add to vocab builder (#12288)
Getting text from xpointers to get the current selected word context would have crengine unhighlight that word. Allow to get it selected again when done getting context.
This commit is contained in:
@@ -1592,7 +1592,7 @@ dbg:guard(ReaderHighlight, "lookup",
|
||||
function ReaderHighlight:getSelectedWordContext(nb_words)
|
||||
if not self.selected_text then return end
|
||||
local ok, prev_context, next_context = pcall(self.ui.document.getSelectedWordContext, self.ui.document,
|
||||
self.selected_text.text, nb_words, self.selected_text.pos0, self.selected_text.pos1)
|
||||
self.selected_text.text, nb_words, self.selected_text.pos0, self.selected_text.pos1, true)
|
||||
if ok then
|
||||
return prev_context, next_context
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user