mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-06 03:53:59 +02:00
Rename CmdLog -> GuiLog
We want to log both actions and commands for the sake of integration tests
This commit is contained in:
parent
9514284f8e
commit
114ad52ff6
@ -30,6 +30,7 @@ func (gui *Gui) LogAction(action string) {
|
||||
|
||||
gui.Views.Extras.Autoscroll = true
|
||||
|
||||
gui.GuiLog = append(gui.GuiLog, action)
|
||||
fmt.Fprint(gui.Views.Extras, "\n"+style.FgYellow.Sprint(action))
|
||||
}
|
||||
|
||||
@ -46,7 +47,7 @@ func (gui *Gui) LogCommand(cmdStr string, commandLine bool) {
|
||||
// we style it differently to communicate that
|
||||
textStyle = style.FgMagenta
|
||||
}
|
||||
gui.CmdLog = append(gui.CmdLog, cmdStr)
|
||||
gui.GuiLog = append(gui.GuiLog, cmdStr)
|
||||
indentedCmdStr := " " + strings.Replace(cmdStr, "\n", "\n ", -1)
|
||||
fmt.Fprint(gui.Views.Extras, "\n"+textStyle.Sprint(indentedCmdStr))
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ type Gui struct {
|
||||
|
||||
Views types.Views
|
||||
|
||||
// Log of the commands that get run, to be displayed to the user.
|
||||
CmdLog []string
|
||||
// Log of the commands/actions logged in the Command Log panel.
|
||||
GuiLog []string
|
||||
|
||||
// the extras window contains things like the command log
|
||||
ShowExtrasWindow bool
|
||||
@ -440,7 +440,7 @@ func NewGui(
|
||||
showRecentRepos: showRecentRepos,
|
||||
RepoPathStack: &utils.StringStack{},
|
||||
RepoStateMap: map[Repo]*GuiRepoState{},
|
||||
CmdLog: []string{},
|
||||
GuiLog: []string{},
|
||||
|
||||
// originally we could only hide the command log permanently via the config
|
||||
// but now we do it via state. So we need to still support the config for the
|
||||
|
@ -64,7 +64,7 @@ func (self *GuiDriver) Fail(message string) {
|
||||
"%s\nFinal Lazygit state:\n%s\nUpon failure, focused view was '%s'.\nLog:\n%s", message,
|
||||
self.gui.g.Snapshot(),
|
||||
currentView.Name(),
|
||||
strings.Join(self.gui.CmdLog, "\n"),
|
||||
strings.Join(self.gui.GuiLog, "\n"),
|
||||
)
|
||||
|
||||
self.gui.g.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user