diff --git a/src/calibre/gui2/tweak_book/editor/widget.py b/src/calibre/gui2/tweak_book/editor/widget.py index f2bec6de25..0b92d02577 100644 --- a/src/calibre/gui2/tweak_book/editor/widget.py +++ b/src/calibre/gui2/tweak_book/editor/widget.py @@ -217,6 +217,7 @@ class Editor(QMainWindow): c = self.editor.textCursor() char = '' if not c.atStart(): + c.clearSelection() c.setPosition(c.position()-1, c.KeepAnchor) char = unicode(c.selectedText()) return (c.blockNumber() + 1, c.positionInBlock(), char)