1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

some refactoring in anticipation of the graph feature

This commit is contained in:
Jesse Duffield
2021-11-01 09:35:54 +11:00
parent 7a464ae5b7
commit 2fc1498517
40 changed files with 523 additions and 411 deletions

View File

@ -458,6 +458,12 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *oscom
return gui, nil
}
var RuneReplacements = map[rune]string{
// for the commit graph
'⏣': "M",
'⎔': "o",
}
// Run setup the gui with keybindings and start the mainloop
func (gui *Gui) Run() error {
recordEvents := recordingEvents()
@ -468,7 +474,7 @@ func (gui *Gui) Run() error {
playMode = gocui.REPLAYING
}
g, err := gocui.NewGui(gocui.OutputTrue, OverlappingEdges, playMode, headless())
g, err := gocui.NewGui(gocui.OutputTrue, OverlappingEdges, playMode, headless(), RuneReplacements)
if err != nil {
return err
}
@ -712,6 +718,7 @@ func (gui *Gui) startBackgroundFetch() {
} else {
gui.goEvery(time.Second*time.Duration(userConfig.Refresher.FetchInterval), gui.stopChan, func() error {
err := gui.fetch(false, "")
gui.render()
return err
})
}