readerhighlight: comment

This commit is contained in:
hius07
2025-03-13 08:13:04 +02:00
committed by GitHub
parent 4ca5b92892
commit 969f58bc56

View File

@@ -1854,6 +1854,8 @@ function ReaderHighlight:onHoldPan(_, ges)
local old_text = self.selected_text and self.selected_text.text
self.selected_text = self.ui.document:getTextFromPositions(self.hold_pos, self.holdpan_pos)
if self.selected_text and self.selected_text.sboxes and #self.selected_text.sboxes == 0 then
-- abort highlighting if crengine doesn't provide sboxes for current positions
-- may happen in TXT files with disabled txt_preformatted
self:clear()
return true
end