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:
poire-z
2024-08-04 23:27:30 +02:00
committed by GitHub
parent c213bd779c
commit 949b996ad7
2 changed files with 11 additions and 2 deletions

View File

@@ -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