Changes keys bindings (#41)

This commit is contained in:
Vladislav Shishkov 2018-10-30 04:50:37 +03:00 committed by Alex Goodman
parent e7a05d4b35
commit c4bb987ccf
2 changed files with 8 additions and 2 deletions

View File

@ -76,6 +76,6 @@ func (view *StatusView) Render() error {
// KeyHelp indicates all the possible global actions a user can take when any pane is selected.
func (view *StatusView) KeyHelp() string {
return renderStatusOption("^C", "Quit", false) +
renderStatusOption("^Space", "Switch view", false) +
renderStatusOption("^/", "Filter files", Views.Filter.IsVisible())
renderStatusOption("^Space or TAB", "Switch view", false) +
renderStatusOption("^/ or ^F", "Filter files", Views.Filter.IsVisible())
}

View File

@ -149,9 +149,15 @@ func keyBindings(g *gocui.Gui) error {
if err := g.SetKeybinding("", gocui.KeyCtrlSpace, gocui.ModNone, toggleView); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyTab, gocui.ModNone, toggleView); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyCtrlSlash, gocui.ModNone, toggleFilterView); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyCtrlF, gocui.ModNone, toggleFilterView); err != nil {
return err
}
return nil
}