From c9b2cdfd6728ef3fced0dc93b5ad6075476b2974 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 24 Nov 2014 08:44:51 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/editor/smarts/python.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/tweak_book/editor/smarts/python.py b/src/calibre/gui2/tweak_book/editor/smarts/python.py index fdf2237427..1a06c3bf8b 100644 --- a/src/calibre/gui2/tweak_book/editor/smarts/python.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/python.py @@ -85,6 +85,7 @@ class Smarts(NullSmarts): elif key == Qt.Key_Home and no_modifiers(ev, Qt.ControlModifier) and not is_cursor_on_wrapped_line(editor): cursor, text = get_text_before_cursor(editor) + cursor = editor.textCursor() mode = cursor.KeepAnchor if test_modifiers(ev, Qt.ShiftModifier) else cursor.MoveAnchor cursor.movePosition(cursor.StartOfBlock, mode) if text.strip():