This commit is contained in:
Kovid Goyal 2014-11-24 08:10:22 +05:30
parent e24f720e69
commit 0745a05399

View File

@ -15,7 +15,7 @@ from calibre.gui2.tweak_book.editor.smarts import NullSmarts
def get_text_before_cursor(editor): def get_text_before_cursor(editor):
cursor = editor.textCursor() cursor = editor.textCursor()
cursor.clearSelection() cursor.clearSelection()
cursor.movePosition(cursor.StartOfLine, cursor.KeepAnchor) cursor.movePosition(cursor.StartOfBlock, cursor.KeepAnchor)
text = cursor.selectedText() text = cursor.selectedText()
return cursor, text return cursor, text