1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-09 07:24:03 +02:00

apply fmt

This commit is contained in:
Dawid Dziurla 2018-08-29 11:56:28 +02:00
parent 6a99d36ae1
commit 77623db1d0
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B
3 changed files with 10 additions and 10 deletions

View File

@ -185,7 +185,7 @@ func (gui *Gui) renderfilesOptions(g *gocui.Gui, file *commands.File) error {
"e": gui.Tr.SLocalize("edit"),
"a": gui.Tr.SLocalize("toggleStagedAll"),
"PgUp/PgDn": gui.Tr.SLocalize("scroll"),
"?": gui.Tr.SLocalize("help"),
"?": gui.Tr.SLocalize("help"),
}
if gui.State.HasMergeConflicts {
optionsMap["a"] = gui.Tr.SLocalize("abortMerge")

View File

@ -1,14 +1,14 @@
package gui
import (
"github.com/jesseduffield/gocui"
"fmt"
"github.com/jesseduffield/gocui"
"strings"
)
func (gui *Gui) renderHelpOptions(g *gocui.Gui) error {
optionsMap := map[string]string{
"esc/q": gui.Tr.SLocalize("close"),
"esc/q": gui.Tr.SLocalize("close"),
"PgUp/PgDn": gui.Tr.SLocalize("scroll"),
}
return gui.renderOptionsMap(g, optionsMap)
@ -47,9 +47,9 @@ func (gui *Gui) handleHelp(g *gocui.Gui, v *gocui.View) error {
gui.renderHelpOptions(g)
for _, binding := range bindings{
for _, binding := range bindings {
if binding.Description != "" {
if curr != binding.ViewName {
if curr != binding.ViewName {
curr = binding.ViewName
content += fmt.Sprintf("\n%s:\n", strings.Title(curr))
}
@ -65,4 +65,4 @@ func (gui *Gui) handleHelp(g *gocui.Gui, v *gocui.View) error {
return nil
})
return nil
}
}

View File

@ -6,10 +6,10 @@ import "github.com/jesseduffield/gocui"
// is only handled if the given view has focus, or handled globally if the view
// is ""
type Binding struct {
ViewName string
Handler func(*gocui.Gui, *gocui.View) error
Key interface{} // FIXME: find out how to get `gocui.Key | rune`
Modifier gocui.Modifier
ViewName string
Handler func(*gocui.Gui, *gocui.View) error
Key interface{} // FIXME: find out how to get `gocui.Key | rune`
Modifier gocui.Modifier
KeyReadable string
Description string
}