diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-27 19:01:40 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-30 18:35:23 +1000 |
commit | e356b29b4a7888a24bca6b3784b9df5b2e3fa34c (patch) | |
tree | 7b2fd826d06e20fb0a700796dd66261f56b59c0c | |
parent | bc4ce26ceff7ff2d8ac5fdc914aea24691591af8 (diff) |
Allow entering a submodule by pressing space
-rw-r--r-- | docs/keybindings/Keybindings_en.md | 2 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_ja.md | 2 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_ko.md | 2 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_nl.md | 2 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_pl.md | 2 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_ru.md | 2 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_zh-CN.md | 2 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_zh-TW.md | 2 | ||||
-rw-r--r-- | pkg/gui/controllers/submodules_controller.go | 5 |
9 files changed, 21 insertions, 0 deletions
diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index 2d8701483..3357d3619 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -317,6 +317,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd><c-o></kbd>: Copy submodule name to clipboard <kbd><enter></kbd>: Enter submodule + <kbd><space></kbd>: Enter submodule <kbd>d</kbd>: Remove submodule <kbd>u</kbd>: Update submodule <kbd>n</kbd>: Add new submodule @@ -344,6 +345,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text diff --git a/docs/keybindings/Keybindings_ja.md b/docs/keybindings/Keybindings_ja.md index ff41c92a2..1adf2de3a 100644 --- a/docs/keybindings/Keybindings_ja.md +++ b/docs/keybindings/Keybindings_ja.md @@ -79,6 +79,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text @@ -146,6 +147,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd><c-o></kbd>: サブモジュール名をクリップボードにコピー <kbd><enter></kbd>: サブモジュールを開く + <kbd><space></kbd>: サブモジュールを開く <kbd>d</kbd>: サブモジュールを削除 <kbd>u</kbd>: サブモジュールを更新 <kbd>n</kbd>: サブモジュールを新規追加 diff --git a/docs/keybindings/Keybindings_ko.md b/docs/keybindings/Keybindings_ko.md index adafbe1e5..837043947 100644 --- a/docs/keybindings/Keybindings_ko.md +++ b/docs/keybindings/Keybindings_ko.md @@ -96,6 +96,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text @@ -210,6 +211,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd><c-o></kbd>: 서브모듈 이름을 클립보드에 복사 <kbd><enter></kbd>: 서브모듈 열기 + <kbd><space></kbd>: 서브모듈 열기 <kbd>d</kbd>: 서브모듈 삭제 <kbd>u</kbd>: 서브모듈 업데이트 <kbd>n</kbd>: 새로운 서브모듈 추가 diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md index e63fde865..13010a4d1 100644 --- a/docs/keybindings/Keybindings_nl.md +++ b/docs/keybindings/Keybindings_nl.md @@ -317,6 +317,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd><c-o></kbd>: Kopieer submodule naam naar klembord <kbd><enter></kbd>: Enter submodule + <kbd><space></kbd>: Enter submodule <kbd>d</kbd>: Remove submodule <kbd>u</kbd>: Update submodule <kbd>n</kbd>: Voeg nieuwe submodule toe @@ -344,6 +345,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md index ce666dd0a..9876d26a7 100644 --- a/docs/keybindings/Keybindings_pl.md +++ b/docs/keybindings/Keybindings_pl.md @@ -310,6 +310,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd><c-o></kbd>: Copy submodule name to clipboard <kbd><enter></kbd>: Enter submodule + <kbd><space></kbd>: Enter submodule <kbd>d</kbd>: Remove submodule <kbd>u</kbd>: Update submodule <kbd>n</kbd>: Add new submodule @@ -337,6 +338,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text diff --git a/docs/keybindings/Keybindings_ru.md b/docs/keybindings/Keybindings_ru.md index 8da16f7f6..fa59d9949 100644 --- a/docs/keybindings/Keybindings_ru.md +++ b/docs/keybindings/Keybindings_ru.md @@ -49,6 +49,7 @@ _Связки клавиш_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text @@ -229,6 +230,7 @@ _Связки клавиш_ <pre> <kbd><c-o></kbd>: Скопировать название подмодуля в буфер обмена <kbd><enter></kbd>: Ввести подмодуль + <kbd><space></kbd>: Ввести подмодуль <kbd>d</kbd>: Удалить подмодуль <kbd>u</kbd>: Обновить подмодуль <kbd>n</kbd>: Добавить новый подмодуль diff --git a/docs/keybindings/Keybindings_zh-CN.md b/docs/keybindings/Keybindings_zh-CN.md index 0bb8336cf..1fcfe987f 100644 --- a/docs/keybindings/Keybindings_zh-CN.md +++ b/docs/keybindings/Keybindings_zh-CN.md @@ -66,6 +66,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text @@ -118,6 +119,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ <pre> <kbd><c-o></kbd>: 将子模块名称复制到剪贴板 <kbd><enter></kbd>: 输入子模块 + <kbd><space></kbd>: 输入子模块 <kbd>d</kbd>: 删除子模块 <kbd>u</kbd>: 更新子模块 <kbd>n</kbd>: 添加新的子模块 diff --git a/docs/keybindings/Keybindings_zh-TW.md b/docs/keybindings/Keybindings_zh-TW.md index 75a36ccbe..960eee73a 100644 --- a/docs/keybindings/Keybindings_zh-TW.md +++ b/docs/keybindings/Keybindings_zh-TW.md @@ -66,6 +66,7 @@ _說明:`<c-b>` 表示 Ctrl+B、`<a-b>` 表示 Alt+B,`B`表示 Shift+B_ <pre> <kbd>n</kbd>: Create worktree <kbd><space></kbd>: Switch to worktree + <kbd><enter></kbd>: Switch to worktree <kbd>o</kbd>: Open in editor <kbd>d</kbd>: Remove worktree <kbd>/</kbd>: Filter the current view by text @@ -162,6 +163,7 @@ _說明:`<c-b>` 表示 Ctrl+B、`<a-b>` 表示 Alt+B,`B`表示 Shift+B_ <pre> <kbd><c-o></kbd>: 複製子模組名稱到剪貼簿 <kbd><enter></kbd>: 進入子模組 + <kbd><space></kbd>: 進入子模組 <kbd>d</kbd>: 移除子模組 <kbd>u</kbd>: 更新子模組 <kbd>n</kbd>: 新增子模組 diff --git a/pkg/gui/controllers/submodules_controller.go b/pkg/gui/controllers/submodules_controller.go index b2cb00635..ebf597d3b 100644 --- a/pkg/gui/controllers/submodules_controller.go +++ b/pkg/gui/controllers/submodules_controller.go @@ -36,6 +36,11 @@ func (self *SubmodulesController) GetKeybindings(opts types.KeybindingsOpts) []* Description: self.c.Tr.EnterSubmodule, }, { + Key: opts.GetKey(opts.Config.Universal.Select), + Handler: self.checkSelected(self.enter), + Description: self.c.Tr.EnterSubmodule, + }, + { Key: opts.GetKey(opts.Config.Universal.Remove), Handler: self.checkSelected(self.remove), Description: self.c.Tr.RemoveSubmodule, |