readerhighlight: stop highlighting when sboxes are absent

This commit is contained in:
hius07
2025-03-12 18:15:34 +02:00
committed by GitHub
parent a7fca869f2
commit fbfb993c6b

View File

@@ -1853,6 +1853,10 @@ 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
self:clear()
return true
end
self.is_word_selection = false
if self.selected_text and self.selected_text.pos0 then