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

This commit is contained in:
Kovid Goyal 2014-12-30 07:21:02 +05:30
parent 3d0859432e
commit 46c6f3a01e

View File

@ -55,7 +55,7 @@ def smart_home(editor, ev):
cursor = editor.textCursor() cursor = editor.textCursor()
mode = cursor.KeepAnchor if test_modifiers(ev, Qt.ShiftModifier) else cursor.MoveAnchor mode = cursor.KeepAnchor if test_modifiers(ev, Qt.ShiftModifier) else cursor.MoveAnchor
cursor.movePosition(cursor.StartOfBlock, mode) cursor.movePosition(cursor.StartOfBlock, mode)
if text.strip(): if text.strip() and text.lstrip() != text:
# Move to the start of text # Move to the start of text
cursor.movePosition(cursor.NextWord, mode) cursor.movePosition(cursor.NextWord, mode)
editor.setTextCursor(cursor) editor.setTextCursor(cursor)