Allow entering a submodule by pressing space

This commit is contained in:
Jesse Duffield 2023-07-27 19:01:40 +10:00
parent bc4ce26cef
commit e356b29b4a
9 changed files with 21 additions and 0 deletions

View file

@ -317,6 +317,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
<pre> <pre>
<kbd>&lt;c-o&gt;</kbd>: Copy submodule name to clipboard <kbd>&lt;c-o&gt;</kbd>: Copy submodule name to clipboard
<kbd>&lt;enter&gt;</kbd>: Enter submodule <kbd>&lt;enter&gt;</kbd>: Enter submodule
<kbd>&lt;space&gt;</kbd>: Enter submodule
<kbd>d</kbd>: Remove submodule <kbd>d</kbd>: Remove submodule
<kbd>u</kbd>: Update submodule <kbd>u</kbd>: Update submodule
<kbd>n</kbd>: Add new 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> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <kbd>/</kbd>: Filter the current view by text

View file

@ -79,6 +79,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
<pre> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <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> <pre>
<kbd>&lt;c-o&gt;</kbd>: サブモジュール名をクリップボードにコピー <kbd>&lt;c-o&gt;</kbd>: サブモジュール名をクリップボードにコピー
<kbd>&lt;enter&gt;</kbd>: サブモジュールを開く <kbd>&lt;enter&gt;</kbd>: サブモジュールを開く
<kbd>&lt;space&gt;</kbd>: サブモジュールを開く
<kbd>d</kbd>: サブモジュールを削除 <kbd>d</kbd>: サブモジュールを削除
<kbd>u</kbd>: サブモジュールを更新 <kbd>u</kbd>: サブモジュールを更新
<kbd>n</kbd>: サブモジュールを新規追加 <kbd>n</kbd>: サブモジュールを新規追加

View file

@ -96,6 +96,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
<pre> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <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> <pre>
<kbd>&lt;c-o&gt;</kbd>: 서브모듈 이름을 클립보드에 복사 <kbd>&lt;c-o&gt;</kbd>: 서브모듈 이름을 클립보드에 복사
<kbd>&lt;enter&gt;</kbd>: 서브모듈 열기 <kbd>&lt;enter&gt;</kbd>: 서브모듈 열기
<kbd>&lt;space&gt;</kbd>: 서브모듈 열기
<kbd>d</kbd>: 서브모듈 삭제 <kbd>d</kbd>: 서브모듈 삭제
<kbd>u</kbd>: 서브모듈 업데이트 <kbd>u</kbd>: 서브모듈 업데이트
<kbd>n</kbd>: 새로운 서브모듈 추가 <kbd>n</kbd>: 새로운 서브모듈 추가

View file

@ -317,6 +317,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
<pre> <pre>
<kbd>&lt;c-o&gt;</kbd>: Kopieer submodule naam naar klembord <kbd>&lt;c-o&gt;</kbd>: Kopieer submodule naam naar klembord
<kbd>&lt;enter&gt;</kbd>: Enter submodule <kbd>&lt;enter&gt;</kbd>: Enter submodule
<kbd>&lt;space&gt;</kbd>: Enter submodule
<kbd>d</kbd>: Remove submodule <kbd>d</kbd>: Remove submodule
<kbd>u</kbd>: Update submodule <kbd>u</kbd>: Update submodule
<kbd>n</kbd>: Voeg nieuwe submodule toe <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> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <kbd>/</kbd>: Filter the current view by text

View file

@ -310,6 +310,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
<pre> <pre>
<kbd>&lt;c-o&gt;</kbd>: Copy submodule name to clipboard <kbd>&lt;c-o&gt;</kbd>: Copy submodule name to clipboard
<kbd>&lt;enter&gt;</kbd>: Enter submodule <kbd>&lt;enter&gt;</kbd>: Enter submodule
<kbd>&lt;space&gt;</kbd>: Enter submodule
<kbd>d</kbd>: Remove submodule <kbd>d</kbd>: Remove submodule
<kbd>u</kbd>: Update submodule <kbd>u</kbd>: Update submodule
<kbd>n</kbd>: Add new 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> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <kbd>/</kbd>: Filter the current view by text

View file

@ -49,6 +49,7 @@ _Связки клавиш_
<pre> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <kbd>/</kbd>: Filter the current view by text
@ -229,6 +230,7 @@ _Связки клавиш_
<pre> <pre>
<kbd>&lt;c-o&gt;</kbd>: Скопировать название подмодуля в буфер обмена <kbd>&lt;c-o&gt;</kbd>: Скопировать название подмодуля в буфер обмена
<kbd>&lt;enter&gt;</kbd>: Ввести подмодуль <kbd>&lt;enter&gt;</kbd>: Ввести подмодуль
<kbd>&lt;space&gt;</kbd>: Ввести подмодуль
<kbd>d</kbd>: Удалить подмодуль <kbd>d</kbd>: Удалить подмодуль
<kbd>u</kbd>: Обновить подмодуль <kbd>u</kbd>: Обновить подмодуль
<kbd>n</kbd>: Добавить новый подмодуль <kbd>n</kbd>: Добавить новый подмодуль

View file

@ -66,6 +66,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
<pre> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <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> <pre>
<kbd>&lt;c-o&gt;</kbd>: 将子模块名称复制到剪贴板 <kbd>&lt;c-o&gt;</kbd>: 将子模块名称复制到剪贴板
<kbd>&lt;enter&gt;</kbd>: 输入子模块 <kbd>&lt;enter&gt;</kbd>: 输入子模块
<kbd>&lt;space&gt;</kbd>: 输入子模块
<kbd>d</kbd>: 删除子模块 <kbd>d</kbd>: 删除子模块
<kbd>u</kbd>: 更新子模块 <kbd>u</kbd>: 更新子模块
<kbd>n</kbd>: 添加新的子模块 <kbd>n</kbd>: 添加新的子模块

View file

@ -66,6 +66,7 @@ _說明`<c-b>` 表示 Ctrl+B、`<a-b>` 表示 Alt+B`B`表示 Shift+B_
<pre> <pre>
<kbd>n</kbd>: Create worktree <kbd>n</kbd>: Create worktree
<kbd>&lt;space&gt;</kbd>: Switch to worktree <kbd>&lt;space&gt;</kbd>: Switch to worktree
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
<kbd>o</kbd>: Open in editor <kbd>o</kbd>: Open in editor
<kbd>d</kbd>: Remove worktree <kbd>d</kbd>: Remove worktree
<kbd>/</kbd>: Filter the current view by text <kbd>/</kbd>: Filter the current view by text
@ -162,6 +163,7 @@ _說明`<c-b>` 表示 Ctrl+B、`<a-b>` 表示 Alt+B`B`表示 Shift+B_
<pre> <pre>
<kbd>&lt;c-o&gt;</kbd>: 複製子模組名稱到剪貼簿 <kbd>&lt;c-o&gt;</kbd>: 複製子模組名稱到剪貼簿
<kbd>&lt;enter&gt;</kbd>: 進入子模組 <kbd>&lt;enter&gt;</kbd>: 進入子模組
<kbd>&lt;space&gt;</kbd>: 進入子模組
<kbd>d</kbd>: 移除子模組 <kbd>d</kbd>: 移除子模組
<kbd>u</kbd>: 更新子模組 <kbd>u</kbd>: 更新子模組
<kbd>n</kbd>: 新增子模組 <kbd>n</kbd>: 新增子模組

View file

@ -35,6 +35,11 @@ func (self *SubmodulesController) GetKeybindings(opts types.KeybindingsOpts) []*
Handler: self.checkSelected(self.enter), Handler: self.checkSelected(self.enter),
Description: self.c.Tr.EnterSubmodule, 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), Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.checkSelected(self.remove), Handler: self.checkSelected(self.remove),