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

support scrolling extras view

This commit is contained in:
Jesse Duffield
2021-04-11 11:43:07 +10:00
parent 8969464b00
commit f2007f4d95
5 changed files with 78 additions and 32 deletions

View File

@ -254,7 +254,7 @@ type Views struct {
SearchPrefix *gocui.View
Limit *gocui.View
Suggestions *gocui.View
CmdLog *gocui.View
Extras *gocui.View
}
type searchingState struct {
@ -475,12 +475,12 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *oscom
currentSpan := ""
return func(entry oscommands.CmdLogEntry) {
if gui.Views.CmdLog == nil {
if gui.Views.Extras == nil {
return
}
if entry.GetSpan() != currentSpan {
fmt.Fprintln(gui.Views.CmdLog, utils.ColoredString(entry.GetSpan(), color.FgYellow))
fmt.Fprintln(gui.Views.Extras, utils.ColoredString(entry.GetSpan(), color.FgYellow))
currentSpan = entry.GetSpan()
}
@ -489,7 +489,8 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *oscom
clrAttr = color.FgMagenta
}
gui.CmdLog = append(gui.CmdLog, entry.GetCmdStr())
fmt.Fprintln(gui.Views.CmdLog, " "+utils.ColoredString(entry.GetCmdStr(), clrAttr))
indentedCmdStr := " " + strings.Replace(entry.GetCmdStr(), "\n", "\n ", -1)
fmt.Fprintln(gui.Views.Extras, utils.ColoredString(indentedCmdStr, clrAttr))
}
}()