From 676b26fc4cb9fc4741b1852417635028b3204742 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Thu, 21 May 2026 18:51:39 +0300 Subject: [PATCH] QRClipboard main: fix extending highlight to sentence (#15431) --- plugins/qrclipboard.koplugin/main.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/qrclipboard.koplugin/main.lua b/plugins/qrclipboard.koplugin/main.lua index 958bbb4ff..ea4c312c6 100644 --- a/plugins/qrclipboard.koplugin/main.lua +++ b/plugins/qrclipboard.koplugin/main.lua @@ -34,8 +34,12 @@ function QRClipboard:addToHighlightDialog() -- 'this' is self.ui.highlight. Do as ReaderHighlight:saveHighlight() does. this:highlightFromHoldPos() if not (this.selected_text and this.selected_text.pos0 and this.selected_text.pos1) then return end - local text = this.ui.rolling - and this.document:extendXPointersToSentenceSegment(this.selected_text.pos0, this.selected_text.pos1) + local text + if this.ui.rolling then + local extended_text = + this.document:extendXPointersToSentenceSegment(this.selected_text.pos0, this.selected_text.pos1) + text = extended_text and extended_text.text + end text = util.cleanupSelectedText(text or this.selected_text.text) if Device:hasClipboard() then -- let the text to be reused via menu Device.input.setClipboardText(text)