mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Fix pressing Ctrl+Tab inserting a tab at the start of a line instead of switching tabs
This commit is contained in:
parent
95fc272b5b
commit
5f6dcd9e8b
@ -67,7 +67,9 @@ class Smarts(NullSmarts):
|
|||||||
if key == Qt.Key.Key_Home and smart_home(editor, ev):
|
if key == Qt.Key.Key_Home and smart_home(editor, ev):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if key == Qt.Key.Key_Tab and smart_tab(editor, ev):
|
if key == Qt.Key.Key_Tab:
|
||||||
|
mods = ev.modifiers()
|
||||||
|
if not mods & Qt.KeyboardModifier.ControlModifier and smart_tab(editor, ev):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if key == Qt.Key.Key_Backspace and smart_backspace(editor, ev):
|
if key == Qt.Key.Key_Backspace and smart_backspace(editor, ev):
|
||||||
|
@ -723,7 +723,9 @@ class Smarts(NullSmarts):
|
|||||||
if key == Qt.Key.Key_Home and smart_home(editor, ev):
|
if key == Qt.Key.Key_Home and smart_home(editor, ev):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if key == Qt.Key.Key_Tab and smart_tab(editor, ev):
|
if key == Qt.Key.Key_Tab:
|
||||||
|
mods = ev.modifiers()
|
||||||
|
if not mods & Qt.KeyboardModifier.ControlModifier and smart_tab(editor, ev):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if key == Qt.Key.Key_Backspace and smart_backspace(editor, ev):
|
if key == Qt.Key.Key_Backspace and smart_backspace(editor, ev):
|
||||||
|
@ -36,7 +36,9 @@ class Smarts(NullSmarts):
|
|||||||
def handle_key_press(self, ev, editor):
|
def handle_key_press(self, ev, editor):
|
||||||
key = ev.key()
|
key = ev.key()
|
||||||
|
|
||||||
if key == Qt.Key.Key_Tab and smart_tab(editor, ev):
|
if key == Qt.Key.Key_Tab:
|
||||||
|
mods = ev.modifiers()
|
||||||
|
if not mods & Qt.KeyboardModifier.ControlModifier and smart_tab(editor, ev):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
elif key == Qt.Key.Key_Backspace and smart_backspace(editor, ev):
|
elif key == Qt.Key.Key_Backspace and smart_backspace(editor, ev):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user