2023-03-21 11:57:52 +02:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
type CommandLogController struct {
|
|
|
|
baseController
|
2023-03-23 09:47:29 +02:00
|
|
|
c *ControllerCommon
|
2023-03-21 11:57:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var _ types.IController = &CommandLogController{}
|
|
|
|
|
|
|
|
func NewCommandLogController(
|
2023-03-23 09:47:29 +02:00
|
|
|
common *ControllerCommon,
|
2023-03-21 11:57:52 +02:00
|
|
|
) *CommandLogController {
|
|
|
|
return &CommandLogController{
|
2023-03-23 09:47:29 +02:00
|
|
|
baseController: baseController{},
|
|
|
|
c: common,
|
2023-03-21 11:57:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (self *CommandLogController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
|
|
|
|
bindings := []*types.Binding{}
|
|
|
|
|
|
|
|
return bindings
|
|
|
|
}
|
|
|
|
|
|
|
|
func (self *CommandLogController) GetOnFocusLost() func(types.OnFocusLostOpts) error {
|
|
|
|
return func(types.OnFocusLostOpts) error {
|
|
|
|
self.c.Views().Extras.Autoscroll = true
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (self *CommandLogController) Context() types.Context {
|
|
|
|
return self.context()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (self *CommandLogController) context() types.Context {
|
2023-03-23 04:04:57 +02:00
|
|
|
return self.c.Contexts().CommandLog
|
2023-03-21 11:57:52 +02:00
|
|
|
}
|