From 6386a038059a967442a6c071c822db522a735f91 Mon Sep 17 00:00:00 2001 From: wakaka6 <48764488+wakaka6@users.noreply.github.com> Date: Sun, 11 Dec 2022 14:18:29 +0800 Subject: [PATCH] add return alt1 --- docs/Config.md | 1 + pkg/config/user_config.go | 1 + pkg/gui/keybindings.go | 6 ++++++ 3 files changed, 8 insertions(+) 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: '' # alternative/alias of quit return: '' # 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: '' # goto the next panel prevItem: '' # 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 @@ -74,6 +74,12 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi Modifier: gocui.ModNone, 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),