mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-20 02:43:22 +02:00
Refactor for reuse
This commit is contained in:
parent
78ebdb8420
commit
ca5e5f4d14
1 changed files with 4 additions and 1 deletions
|
|
@ -31,6 +31,9 @@
|
|||
|
||||
PARAGRAPH_SEPARATOR = '\u2029'
|
||||
|
||||
def selected_text_from_cursor(cursor):
|
||||
return unicodedata.normalize('NFC', unicode(cursor.selectedText()).replace(PARAGRAPH_SEPARATOR, '\n').rstrip('\0'))
|
||||
|
||||
def get_highlighter(syntax):
|
||||
if syntax:
|
||||
try:
|
||||
|
|
@ -111,7 +114,7 @@ def cut(self):
|
|||
self.textCursor().removeSelectedText()
|
||||
|
||||
def selected_text_from_cursor(self, cursor):
|
||||
return unicodedata.normalize('NFC', unicode(cursor.selectedText()).replace(PARAGRAPH_SEPARATOR, '\n').rstrip('\0'))
|
||||
return selected_text_from_cursor(cursor)
|
||||
|
||||
@property
|
||||
def selected_text(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue