From fff1a259814a11cb18e77ccc8f0d5e942f276634 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 18 Jan 2014 17:09:30 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/editor/text.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index a916fe68fc..cd5e3ef240 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -87,6 +87,10 @@ class PlainTextEdit(QPlainTextEdit): self.copy() self.textCursor().removeSelectedText() + @property + def selected_text(self): + return unicodedata.normalize('NFC', unicode(self.textCursor().selectedText()).replace(PARAGRAPH_SEPARATOR, '\n')) + def selection_changed(self): # Workaround Qt replacing nbsp with normal spaces on copy clipboard = QApplication.clipboard() @@ -127,10 +131,6 @@ class TextEdit(PlainTextEdit): self.document().setModified(bool(val)) return property(fget=fget, fset=fset) - @property - def selected_text(self): - return unicodedata.normalize('NFC', unicode(self.textCursor().selectedText()).replace(PARAGRAPH_SEPARATOR, '\n')) - def sizeHint(self): return self.size_hint