From 0745a05399cd0463c78f10ba7f7adc935264f04a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 24 Nov 2014 08:10:22 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/editor/smarts/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/smarts/python.py b/src/calibre/gui2/tweak_book/editor/smarts/python.py index 3dc97a0e79..6271a76203 100644 --- a/src/calibre/gui2/tweak_book/editor/smarts/python.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/python.py @@ -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