mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
...
This commit is contained in:
parent
e24f720e69
commit
0745a05399
@ -15,7 +15,7 @@ from calibre.gui2.tweak_book.editor.smarts import NullSmarts
|
||||
def get_text_before_cursor(editor):
|
||||
cursor = editor.textCursor()
|
||||
cursor.clearSelection()
|
||||
cursor.movePosition(cursor.StartOfLine, cursor.KeepAnchor)
|
||||
cursor.movePosition(cursor.StartOfBlock, cursor.KeepAnchor)
|
||||
text = cursor.selectedText()
|
||||
return cursor, text
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user