diff --git a/docs-master/Config.md b/docs-master/Config.md index dd0a7dd11..90ddde045 100644 --- a/docs-master/Config.md +++ b/docs-master/Config.md @@ -780,6 +780,8 @@ keybinding: commitFiles: checkoutCommitFile: c main: + prevHunk: [, h] + nextHunk: [, l] toggleSelectHunk: a pickBothHunks: b editSelectHunk: E diff --git a/docs-master/keybindings/Keybindings_en.md b/docs-master/keybindings/Keybindings_en.md index 8191c6b8b..fafa7312d 100644 --- a/docs-master/keybindings/Keybindings_en.md +++ b/docs-master/keybindings/Keybindings_en.md @@ -207,8 +207,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | Pick all hunks | | | `` `` | Previous hunk | | | `` `` | Next hunk | | -| `` `` | Previous conflict | | -| `` `` | Next conflict | | +| `` , h `` | Previous conflict | | +| `` , l `` | Next conflict | | | `` z `` | Undo | Undo last merge conflict resolution. | | `` e `` | Edit file | Open file in external editor. | | `` o `` | Open file | Open file in default application. | @@ -229,8 +229,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Go to previous hunk | | -| `` `` | Go to next hunk | | +| `` , h `` | Go to previous hunk | | +| `` , l `` | Go to next hunk | | | `` v `` | Toggle range select | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Copy selected text to clipboard | | @@ -245,8 +245,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Go to previous hunk | | -| `` `` | Go to next hunk | | +| `` , h `` | Go to previous hunk | | +| `` , l `` | Go to next hunk | | | `` v `` | Toggle range select | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Copy selected text to clipboard | | diff --git a/docs-master/keybindings/Keybindings_ja.md b/docs-master/keybindings/Keybindings_ja.md index 0d51ebe7f..4b5bfc9f3 100644 --- a/docs-master/keybindings/Keybindings_ja.md +++ b/docs-master/keybindings/Keybindings_ja.md @@ -248,8 +248,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 前のハンクに移動 | | -| `` `` | 次のハンクに移動 | | +| `` , h `` | 前のハンクに移動 | | +| `` , l `` | 次のハンクに移動 | | | `` v `` | 範囲選択を切り替え | | | `` a `` | ハンクの選択を切り替える | Toggle line-by-line vs. hunk selection mode. | | `` `` | 選択したテキストをクリップボードにコピー | | @@ -270,8 +270,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 前のハンクに移動 | | -| `` `` | 次のハンクに移動 | | +| `` , h `` | 前のハンクに移動 | | +| `` , l `` | 次のハンクに移動 | | | `` v `` | 範囲選択を切り替え | | | `` a `` | ハンクの選択を切り替える | Toggle line-by-line vs. hunk selection mode. | | `` `` | 選択したテキストをクリップボードにコピー | | @@ -290,8 +290,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | すべてのハンクを選択 | | | `` `` | 前のハンク | | | `` `` | 次のハンク | | -| `` `` | 前のコンフリクト | | -| `` `` | 次のコンフリクト | | +| `` , h `` | 前のコンフリクト | | +| `` , l `` | 次のコンフリクト | | | `` z `` | 元に戻す | 最後のマージコンフリクト解決を元に戻します。 | | `` e `` | ファイルを編集 | 外部エディタでファイルを開きます。 | | `` o `` | ファイルを開く | デフォルトのアプリケーションでファイルを開きます。 | diff --git a/docs-master/keybindings/Keybindings_ko.md b/docs-master/keybindings/Keybindings_ko.md index d183f82de..157984a9c 100644 --- a/docs-master/keybindings/Keybindings_ko.md +++ b/docs-master/keybindings/Keybindings_ko.md @@ -146,8 +146,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | Pick all hunks | | | `` `` | 이전 hunk를 선택 | | | `` `` | 다음 hunk를 선택 | | -| `` `` | 이전 충돌을 선택 | | -| `` `` | 다음 충돌을 선택 | | +| `` , h `` | 이전 충돌을 선택 | | +| `` , l `` | 다음 충돌을 선택 | | | `` z `` | 되돌리기 | Undo last merge conflict resolution. | | `` e `` | 파일 편집 | Open file in external editor. | | `` o `` | 파일 닫기 | Open file in default application. | @@ -168,8 +168,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 이전 hunk를 선택 | | -| `` `` | 다음 hunk를 선택 | | +| `` , h `` | 이전 hunk를 선택 | | +| `` , l `` | 다음 hunk를 선택 | | | `` v `` | 드래그 선택 전환 | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | 선택한 텍스트를 클립보드에 복사 | | @@ -184,8 +184,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 이전 hunk를 선택 | | -| `` `` | 다음 hunk를 선택 | | +| `` , h `` | 이전 hunk를 선택 | | +| `` , l `` | 다음 hunk를 선택 | | | `` v `` | 드래그 선택 전환 | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | 선택한 텍스트를 클립보드에 복사 | | diff --git a/docs-master/keybindings/Keybindings_nl.md b/docs-master/keybindings/Keybindings_nl.md index 8b01ad9da..ca3449cf9 100644 --- a/docs-master/keybindings/Keybindings_nl.md +++ b/docs-master/keybindings/Keybindings_nl.md @@ -215,8 +215,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | Kies beide stukken | | | `` `` | Selecteer bovenste hunk | | | `` `` | Selecteer onderste hunk | | -| `` `` | Selecteer voorgaand conflict | | -| `` `` | Selecteer volgende conflict | | +| `` , h `` | Selecteer voorgaand conflict | | +| `` , l `` | Selecteer volgende conflict | | | `` z `` | Ongedaan maken | Undo last merge conflict resolution. | | `` e `` | Verander bestand | Open file in external editor. | | `` o `` | Open bestand | Open file in default application. | @@ -237,8 +237,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Selecteer de vorige hunk | | -| `` `` | Selecteer de volgende hunk | | +| `` , h `` | Selecteer de vorige hunk | | +| `` , l `` | Selecteer de volgende hunk | | | `` v `` | Toggle drag selecteer | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Copy selected text to clipboard | | @@ -312,8 +312,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Selecteer de vorige hunk | | -| `` `` | Selecteer de volgende hunk | | +| `` , h `` | Selecteer de vorige hunk | | +| `` , l `` | Selecteer de volgende hunk | | | `` v `` | Toggle drag selecteer | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Copy selected text to clipboard | | diff --git a/docs-master/keybindings/Keybindings_pl.md b/docs-master/keybindings/Keybindings_pl.md index 36d3c58a2..69e60b78d 100644 --- a/docs-master/keybindings/Keybindings_pl.md +++ b/docs-master/keybindings/Keybindings_pl.md @@ -115,8 +115,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Idź do poprzedniego fragmentu | | -| `` `` | Idź do następnego fragmentu | | +| `` , h `` | Idź do poprzedniego fragmentu | | +| `` , l `` | Idź do następnego fragmentu | | | `` v `` | Przełącz zaznaczenie zakresu | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Kopiuj zaznaczony tekst do schowka | | @@ -191,8 +191,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | Wybierz wszystkie fragmenty | | | `` `` | Poprzedni fragment | | | `` `` | Następny fragment | | -| `` `` | Poprzedni konflikt | | -| `` `` | Następny konflikt | | +| `` , h `` | Poprzedni konflikt | | +| `` , l `` | Następny konflikt | | | `` z `` | Cofnij | Cofnij ostatnie rozwiązanie konfliktu scalania. | | `` e `` | Edytuj plik | Otwórz plik w zewnętrznym edytorze. | | `` o `` | Otwórz plik | Otwórz plik w domyślnej aplikacji. | @@ -203,8 +203,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Idź do poprzedniego fragmentu | | -| `` `` | Idź do następnego fragmentu | | +| `` , h `` | Idź do poprzedniego fragmentu | | +| `` , l `` | Idź do następnego fragmentu | | | `` v `` | Przełącz zaznaczenie zakresu | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Kopiuj zaznaczony tekst do schowka | | diff --git a/docs-master/keybindings/Keybindings_pt.md b/docs-master/keybindings/Keybindings_pt.md index 17835d1a4..0152530f0 100644 --- a/docs-master/keybindings/Keybindings_pt.md +++ b/docs-master/keybindings/Keybindings_pt.md @@ -241,8 +241,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Ir para o local anterior | | -| `` `` | Ir para o próximo trecho | | +| `` , h `` | Ir para o local anterior | | +| `` , l `` | Ir para o próximo trecho | | | `` v `` | Toggle range select | | | `` a `` | Toggle hunk selection | Ativa/desativa modo linha por linha vs. modo de seleção por partes. | | `` `` | Copiar texto selecionado para área de transferência | | @@ -275,8 +275,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | Pegar todos os pedaços | | | `` `` | Trecho anterior | | | `` `` | Próximo trecho | | -| `` `` | Conflito anterior | | -| `` `` | Próximo conflito | | +| `` , h `` | Conflito anterior | | +| `` , l `` | Próximo conflito | | | `` z `` | Desfazer | Desfazer resolução de conflitos de última mesclagem. | | `` e `` | Editar arquivo | Abrir arquivo no editor externo. | | `` o `` | Abrir arquivo | Abrir arquivo no aplicativo padrão. | @@ -287,8 +287,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Ir para o local anterior | | -| `` `` | Ir para o próximo trecho | | +| `` , h `` | Ir para o local anterior | | +| `` , l `` | Ir para o próximo trecho | | | `` v `` | Toggle range select | | | `` a `` | Toggle hunk selection | Ativa/desativa modo linha por linha vs. modo de seleção por partes. | | `` `` | Copiar texto selecionado para área de transferência | | diff --git a/docs-master/keybindings/Keybindings_ru.md b/docs-master/keybindings/Keybindings_ru.md index 538a05ef0..697912e5a 100644 --- a/docs-master/keybindings/Keybindings_ru.md +++ b/docs-master/keybindings/Keybindings_ru.md @@ -80,8 +80,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Выбрать предыдущую часть | | -| `` `` | Выбрать следующую часть | | +| `` , h `` | Выбрать предыдущую часть | | +| `` , l `` | Выбрать следующую часть | | | `` v `` | Переключить выборку перетаскивания | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Скопировать выделенный текст в буфер обмена | | @@ -116,8 +116,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | Выбрать все части | | | `` `` | Выбрать предыдущую часть | | | `` `` | Выбрать следующую часть | | -| `` `` | Выбрать предыдущий конфликт | | -| `` `` | Выбрать следующий конфликт | | +| `` , h `` | Выбрать предыдущий конфликт | | +| `` , l `` | Выбрать следующий конфликт | | | `` z `` | Отменить | Undo last merge conflict resolution. | | `` e `` | Редактировать файл | Open file in external editor. | | `` o `` | Открыть файл | Open file in default application. | @@ -128,8 +128,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | Выбрать предыдущую часть | | -| `` `` | Выбрать следующую часть | | +| `` , h `` | Выбрать предыдущую часть | | +| `` , l `` | Выбрать следующую часть | | | `` v `` | Переключить выборку перетаскивания | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | Скопировать выделенный текст в буфер обмена | | diff --git a/docs-master/keybindings/Keybindings_zh-CN.md b/docs-master/keybindings/Keybindings_zh-CN.md index b144b08cd..fcd78596a 100644 --- a/docs-master/keybindings/Keybindings_zh-CN.md +++ b/docs-master/keybindings/Keybindings_zh-CN.md @@ -252,8 +252,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 选择上一个区块 | | -| `` `` | 选择下一个区块 | | +| `` , h `` | 选择上一个区块 | | +| `` , l `` | 选择下一个区块 | | | `` v `` | 切换拖动选择 | | | `` a `` | 切换代码块选择 | 切换逐行选择与代码块选择模式。 | | `` `` | 复制选中文本到剪贴板 | | @@ -296,8 +296,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | 选中所有区块 | | | `` `` | 选择顶部块 | | | `` `` | 选择底部块 | | -| `` `` | 选择上一个冲突 | | -| `` `` | 选择下一个冲突 | | +| `` , h `` | 选择上一个冲突 | | +| `` , l `` | 选择下一个冲突 | | | `` z `` | 撤销 | 撤消上次合并冲突解决 | | `` e `` | 编辑文件 | 使用外部编辑器打开文件 | | `` o `` | 打开文件 | 使用默认程序打开该文件 | @@ -308,8 +308,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 选择上一个区块 | | -| `` `` | 选择下一个区块 | | +| `` , h `` | 选择上一个区块 | | +| `` , l `` | 选择下一个区块 | | | `` v `` | 切换拖动选择 | | | `` a `` | 切换代码块选择 | 切换逐行选择与代码块选择模式。 | | `` `` | 复制选中文本到剪贴板 | | diff --git a/docs-master/keybindings/Keybindings_zh-TW.md b/docs-master/keybindings/Keybindings_zh-TW.md index 5e7892bd9..2c2456e4a 100644 --- a/docs-master/keybindings/Keybindings_zh-TW.md +++ b/docs-master/keybindings/Keybindings_zh-TW.md @@ -62,8 +62,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 選擇上一段 | | -| `` `` | 選擇下一段 | | +| `` , h `` | 選擇上一段 | | +| `` , l `` | 選擇下一段 | | | `` v `` | 切換拖曳選擇 | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | 複製所選文本至剪貼簿 | | @@ -92,8 +92,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` b `` | 挑選所有程式碼片段 | | | `` `` | 選擇上一段 | | | `` `` | 選擇下一段 | | -| `` `` | 選擇上一個衝突 | | -| `` `` | 選擇下一個衝突 | | +| `` , h `` | 選擇上一個衝突 | | +| `` , l `` | 選擇下一個衝突 | | | `` z `` | 復原 | Undo last merge conflict resolution. | | `` e `` | 編輯檔案 | 使用外部編輯器開啟 | | `` o `` | 開啟檔案 | 使用預設軟體開啟 | @@ -104,8 +104,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| -| `` `` | 選擇上一段 | | -| `` `` | 選擇下一段 | | +| `` , h `` | 選擇上一段 | | +| `` , l `` | 選擇下一段 | | | `` v `` | 切換拖曳選擇 | | | `` a `` | Toggle hunk selection | Toggle line-by-line vs. hunk selection mode. | | `` `` | 複製所選文本至剪貼簿 | | diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index a5525804d..6956d4366 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -607,6 +607,8 @@ type KeybindingCommitFilesConfig struct { } type KeybindingMainConfig struct { + PrevHunk Keybinding `yaml:"prevHunk"` + NextHunk Keybinding `yaml:"nextHunk"` ToggleSelectHunk Keybinding `yaml:"toggleSelectHunk"` PickBothHunks Keybinding `yaml:"pickBothHunks"` EditSelectHunk Keybinding `yaml:"editSelectHunk"` @@ -1088,6 +1090,8 @@ func GetDefaultConfigForPlatform(platform string) *UserConfig { CheckoutCommitFile: Keybinding{"c"}, }, Main: KeybindingMainConfig{ + PrevHunk: Keybinding{"", "h"}, + NextHunk: Keybinding{"", "l"}, ToggleSelectHunk: Keybinding{"a"}, PickBothHunks: Keybinding{"b"}, EditSelectHunk: Keybinding{"E"}, diff --git a/pkg/gui/controllers/merge_conflicts_controller.go b/pkg/gui/controllers/merge_conflicts_controller.go index a539e710f..322d1cd39 100644 --- a/pkg/gui/controllers/merge_conflicts_controller.go +++ b/pkg/gui/controllers/merge_conflicts_controller.go @@ -52,13 +52,13 @@ func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts) DisplayOnScreen: true, }, { - Keys: opts.GetKeys(opts.Config.Universal.PrevBlock), + Keys: opts.GetKeys(opts.Config.Main.PrevHunk), Handler: self.withRenderAndFocus(self.PrevConflict), Description: self.c.Tr.PrevConflict, DisplayOnScreen: true, }, { - Keys: opts.GetKeys(opts.Config.Universal.NextBlock), + Keys: opts.GetKeys(opts.Config.Main.NextHunk), Handler: self.withRenderAndFocus(self.NextConflict), Description: self.c.Tr.NextConflict, DisplayOnScreen: true, @@ -83,14 +83,6 @@ func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts) Description: self.c.Tr.OpenFile, Tooltip: self.c.Tr.OpenFileTooltip, }, - { - Keys: opts.GetKeys(opts.Config.Universal.PrevBlockAlt), - Handler: self.withRenderAndFocus(self.PrevConflict), - }, - { - Keys: opts.GetKeys(opts.Config.Universal.NextBlockAlt), - Handler: self.withRenderAndFocus(self.NextConflict), - }, { Keys: opts.GetKeys(opts.Config.Universal.PrevItemAlt), Handler: self.withRenderAndFocus(self.PrevConflictHunk), diff --git a/pkg/gui/controllers/patch_explorer_controller.go b/pkg/gui/controllers/patch_explorer_controller.go index 14bce304e..6f7e766af 100644 --- a/pkg/gui/controllers/patch_explorer_controller.go +++ b/pkg/gui/controllers/patch_explorer_controller.go @@ -72,23 +72,15 @@ func (self *PatchExplorerController) GetKeybindings(opts types.KeybindingsOpts) Description: self.c.Tr.RangeSelectDown, }, { - Keys: opts.GetKeys(opts.Config.Universal.PrevBlock), + Keys: opts.GetKeys(opts.Config.Main.PrevHunk), Handler: self.withRenderAndFocus(self.HandlePrevHunk), Description: self.c.Tr.PrevHunk, }, { - Keys: opts.GetKeys(opts.Config.Universal.PrevBlockAlt), - Handler: self.withRenderAndFocus(self.HandlePrevHunk), - }, - { - Keys: opts.GetKeys(opts.Config.Universal.NextBlock), + Keys: opts.GetKeys(opts.Config.Main.NextHunk), Handler: self.withRenderAndFocus(self.HandleNextHunk), Description: self.c.Tr.NextHunk, }, - { - Keys: opts.GetKeys(opts.Config.Universal.NextBlockAlt), - Handler: self.withRenderAndFocus(self.HandleNextHunk), - }, { Keys: opts.GetKeys(opts.Config.Universal.ToggleRangeSelect), Handler: self.withRenderAndFocus(self.HandleToggleSelectRange), diff --git a/schema-master/config.json b/schema-master/config.json index a33e20f2d..b879ba5c5 100644 --- a/schema-master/config.json +++ b/schema-master/config.json @@ -1921,6 +1921,40 @@ }, "KeybindingMainConfig": { "properties": { + "prevHunk": { + "oneOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "default": [ + "\u003cleft\u003e", + "h" + ] + }, + "nextHunk": { + "oneOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "default": [ + "\u003cright\u003e", + "l" + ] + }, "toggleSelectHunk": { "oneOf": [ {