From 46c6f3a01efee319cde0faee037e8a8e9b7b7052 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 30 Dec 2014 07:21:02 +0530 Subject: [PATCH] Edit Book: Fix a regression that caused the Home key to not move to the start of the line on lines containing un-indented tags --- src/calibre/gui2/tweak_book/editor/smarts/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/smarts/utils.py b/src/calibre/gui2/tweak_book/editor/smarts/utils.py index 0632d77943..faf7fecb1b 100644 --- a/src/calibre/gui2/tweak_book/editor/smarts/utils.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/utils.py @@ -55,7 +55,7 @@ def smart_home(editor, ev): cursor = editor.textCursor() mode = cursor.KeepAnchor if test_modifiers(ev, Qt.ShiftModifier) else cursor.MoveAnchor cursor.movePosition(cursor.StartOfBlock, mode) - if text.strip(): + if text.strip() and text.lstrip() != text: # Move to the start of text cursor.movePosition(cursor.NextWord, mode) editor.setTextCursor(cursor)