mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
simplify how we log commands
This commit is contained in:
@ -13,9 +13,6 @@ import (
|
||||
)
|
||||
|
||||
func (gui *Gui) GetOnRunCommand() func(entry oscommands.CmdLogEntry) {
|
||||
// closing over this so that nobody else can modify it
|
||||
currentSpan := ""
|
||||
|
||||
return func(entry oscommands.CmdLogEntry) {
|
||||
if gui.Views.Extras == nil {
|
||||
return
|
||||
@ -23,11 +20,6 @@ func (gui *Gui) GetOnRunCommand() func(entry oscommands.CmdLogEntry) {
|
||||
|
||||
gui.Views.Extras.Autoscroll = true
|
||||
|
||||
if entry.GetSpan() != currentSpan {
|
||||
fmt.Fprint(gui.Views.Extras, "\n"+style.FgYellow.Sprint(entry.GetSpan()))
|
||||
currentSpan = entry.GetSpan()
|
||||
}
|
||||
|
||||
textStyle := theme.DefaultTextColor
|
||||
if !entry.GetCommandLine() {
|
||||
textStyle = style.FgMagenta
|
||||
@ -38,6 +30,16 @@ func (gui *Gui) GetOnRunCommand() func(entry oscommands.CmdLogEntry) {
|
||||
}
|
||||
}
|
||||
|
||||
func (gui *Gui) logSpan(span string) {
|
||||
if gui.Views.Extras == nil {
|
||||
return
|
||||
}
|
||||
|
||||
gui.Views.Extras.Autoscroll = true
|
||||
|
||||
fmt.Fprint(gui.Views.Extras, "\n"+style.FgYellow.Sprint(span))
|
||||
}
|
||||
|
||||
func (gui *Gui) printCommandLogHeader() {
|
||||
introStr := fmt.Sprintf(
|
||||
gui.Tr.CommandLogHeader,
|
||||
|
Reference in New Issue
Block a user