1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-25 12:24:47 +02:00

remove redundant comments

This commit is contained in:
Jesse Duffield 2018-09-12 18:47:37 +10:00
parent f8b484f638
commit 31c33dfdcb

View File

@ -8,12 +8,6 @@ import (
"github.com/jesseduffield/lazygit/pkg/utils"
)
// I need to store the handler function in state and it will take an interface and do something with it
// I need to have another function describing how to display one of the structs
// perhaps this calls for an interface where the struct is Binding and the interface has the methods Display and Execute
// but this means that for the one struct I can only have one possible display/execute function, but I want to use whatever I want.
// Would I ever need to use different handlers for different things? Maybe I should assume not given that I can cross that bridge when I come to it
func (gui *Gui) handleMenuPress(g *gocui.Gui, v *gocui.View) error {
lineNumber := gui.getItemPosition(v)
if gui.State.Keys[lineNumber].Key == nil {
@ -111,10 +105,8 @@ func (gui *Gui) handleMenu(g *gocui.Gui, v *gocui.View) error {
content := append(contentPanel, contentGlobal...)
gui.State.Keys = append(bindingsPanel, bindingsGlobal...)
// append newline at the end so the last line would be selectable
contentJoined := strings.Join(content, "\n")
// y1-1 so there will not be an extra space at the end of panel
x0, y0, x1, y1 := gui.getConfirmationPanelDimensions(g, contentJoined)
menuView, _ := g.SetView("menu", x0, y0, x1, y1, 0)
menuView.Title = strings.Title(gui.Tr.SLocalize("menu"))