mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-15 01:34:26 +02:00
Add pageUp/pageDown/top/bottom keybindings to focused command log panel
This commit is contained in:
@ -58,6 +58,38 @@ func (gui *Gui) scrollDownExtra() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) pageUpExtrasPanel() error {
|
||||||
|
gui.Views.Extras.Autoscroll = false
|
||||||
|
|
||||||
|
gui.Views.Extras.ScrollUp(gui.Contexts().CommandLog.GetViewTrait().PageDelta())
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) pageDownExtrasPanel() error {
|
||||||
|
gui.Views.Extras.Autoscroll = false
|
||||||
|
|
||||||
|
gui.Views.Extras.ScrollDown(gui.Contexts().CommandLog.GetViewTrait().PageDelta())
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) goToExtrasPanelTop() error {
|
||||||
|
gui.Views.Extras.Autoscroll = false
|
||||||
|
|
||||||
|
gui.Views.Extras.ScrollUp(gui.Views.Extras.ViewLinesHeight())
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) goToExtrasPanelBottom() error {
|
||||||
|
gui.Views.Extras.Autoscroll = true
|
||||||
|
|
||||||
|
gui.Views.Extras.ScrollDown(gui.Views.Extras.ViewLinesHeight())
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (gui *Gui) getCmdWriter() io.Writer {
|
func (gui *Gui) getCmdWriter() io.Writer {
|
||||||
return &prefixWriter{writer: gui.Views.Extras, prefix: style.FgMagenta.Sprintf("\n\n%s\n", gui.c.Tr.GitOutput)}
|
return &prefixWriter{writer: gui.Views.Extras, prefix: style.FgMagenta.Sprintf("\n\n%s\n", gui.c.Tr.GitOutput)}
|
||||||
}
|
}
|
||||||
|
@ -341,6 +341,42 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
|
|||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: self.scrollDownExtra,
|
Handler: self.scrollDownExtra,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ViewName: "extras",
|
||||||
|
Key: opts.GetKey(opts.Config.Universal.NextPage),
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: self.pageDownExtrasPanel,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ViewName: "extras",
|
||||||
|
Key: opts.GetKey(opts.Config.Universal.PrevPage),
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: self.pageUpExtrasPanel,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ViewName: "extras",
|
||||||
|
Key: opts.GetKey(opts.Config.Universal.GotoTop),
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: self.goToExtrasPanelTop,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ViewName: "extras",
|
||||||
|
Key: opts.GetKey(opts.Config.Universal.GotoTopAlt),
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: self.goToExtrasPanelTop,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ViewName: "extras",
|
||||||
|
Key: opts.GetKey(opts.Config.Universal.GotoBottom),
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: self.goToExtrasPanelBottom,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ViewName: "extras",
|
||||||
|
Key: opts.GetKey(opts.Config.Universal.GotoBottomAlt),
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: self.goToExtrasPanelBottom,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ViewName: "extras",
|
ViewName: "extras",
|
||||||
Tag: "navigation",
|
Tag: "navigation",
|
||||||
|
Reference in New Issue
Block a user