mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-11-19 04:53:05 -05: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