From 068102d995cdaa1d5908591306a16d1c2869e457 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Thu, 20 Jan 2022 01:20:37 -0800 Subject: [PATCH] diff: wire up "S" for staging selected lines Closes #1187 Signed-off-by: David Aguilar --- CHANGES.rst | 3 +++ cola/hotkeys.py | 1 + cola/widgets/diff.py | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 87d071b2..ed17ca73 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -19,6 +19,9 @@ Usability, bells and whistles key is pressed. (`#1162 `_) +* ``S`` is stages selected lines (in addition to ``s``). + (`#1187 `_) + Fixes ----- * The vendored qtpy library was patched to retain Python2 compatibility. diff --git a/cola/hotkeys.py b/cola/hotkeys.py index a9bb2532..9f92ae31 100644 --- a/cola/hotkeys.py +++ b/cola/hotkeys.py @@ -57,6 +57,7 @@ REFRESH = hotkey(Qt.CTRL + Qt.Key_R) REFRESH_SECONDARY = hotkey(Qt.Key_F5) REFRESH_HOTKEYS = (REFRESH, REFRESH_SECONDARY) STAGE_DIFF = hotkey(Qt.Key_S) +STAGE_DIFF_ALT = hotkey(Qt.SHIFT + Qt.Key_S) STAGE_SELECTION = hotkey(Qt.CTRL + Qt.Key_S) STAGE_ALL = hotkey(Qt.CTRL + Qt.SHIFT + Qt.Key_S) STASH = hotkey(Qt.ALT + Qt.SHIFT + Qt.Key_S) diff --git a/cola/widgets/diff.py b/cola/widgets/diff.py index 377a203a..49d3dca0 100644 --- a/cola/widgets/diff.py +++ b/cola/widgets/diff.py @@ -723,7 +723,11 @@ class DiffEditor(DiffTextEdit): self.options = options self.action_apply_selection = qtutils.add_action( - self, 'Apply', self.apply_selection, hotkeys.STAGE_DIFF + self, + 'Apply', + self.apply_selection, + hotkeys.STAGE_DIFF, + hotkeys.STAGE_DIFF_ALT, ) self.action_revert_selection = qtutils.add_action( -- 2.11.4.GIT