summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-11 11:43:07 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-11 17:07:49 +1000
commitf2007f4d95b7d8b9c454bb00ea087f09a52a4fb4 (patch)
tree499d74d9622f49622421a13494ce82c63901c47e /pkg/gui/gui.go
parent8969464b00c91f3aec1a0ff6e9724eacd87c790f (diff)
support scrolling extras view
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index d152200cb..4d104faf2 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -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))
}
}()