summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwakaka6 <48764488+wakaka6@users.noreply.github.com>2022-12-11 14:18:29 +0800
committerwakaka6 <48764488+wakaka6@users.noreply.github.com>2022-12-11 15:44:25 +0800
commit6386a038059a967442a6c071c822db522a735f91 (patch)
treeefdec1f2ff7f9194542f5d90c740b898e328cb29
parentd69b2fef9a164ee082b93096110aa23a37c77334 (diff)
add return alt1
-rw-r--r--docs/Config.md1
-rw-r--r--pkg/config/user_config.go1
-rw-r--r--pkg/gui/keybindings.go6
3 files changed, 8 insertions, 0 deletions
diff --git a/docs/Config.md b/docs/Config.md
index 691f791f5..8b7780775 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -113,6 +113,7 @@ keybinding:
quit: 'q'
quit-alt1: '<c-c>' # alternative/alias of quit
return: '<esc>' # return to previous menu, will quit if there's nowhere to return
+ return-alt1: ';' # Can be set as a single character key to return to the previous menu level
quitWithoutChangingDirectory: 'Q'
togglePanel: '<tab>' # goto the next panel
prevItem: '<up>' # go one line up
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index d0e909a2a..17d50e8a0 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -136,6 +136,7 @@ type KeybindingUniversalConfig struct {
Quit string `yaml:"quit"`
QuitAlt1 string `yaml:"quit-alt1"`
Return string `yaml:"return"`
+ ReturnAlt1 string `yaml:"return-alt1"`
QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"`
TogglePanel string `yaml:"togglePanel"`
PrevItem string `yaml:"prevItem"`
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 8982a3056..383b52b32 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -75,6 +75,12 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Handler: self.handleTopLevelReturn,
},
{
+ ViewName: "",
+ Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
+ Modifier: gocui.ModNone,
+ Handler: self.handleTopLevelReturn,
+ },
+ {
ViewName: "",
Key: opts.GetKey(opts.Config.Universal.OpenRecentRepos),
Handler: self.handleCreateRecentReposMenu,