mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-17 01:42:45 +02:00
Cleanup: move SetLineSelectMode into AdjustSelectedLineIdx
This commit is contained in:
@ -244,14 +244,12 @@ func (self *PatchExplorerController) HandleScrollRight() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *PatchExplorerController) HandlePrevPage() error {
|
func (self *PatchExplorerController) HandlePrevPage() error {
|
||||||
self.context.GetState().SetLineSelectMode()
|
|
||||||
self.context.GetState().AdjustSelectedLineIdx(-self.context.GetViewTrait().PageDelta())
|
self.context.GetState().AdjustSelectedLineIdx(-self.context.GetViewTrait().PageDelta())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *PatchExplorerController) HandleNextPage() error {
|
func (self *PatchExplorerController) HandleNextPage() error {
|
||||||
self.context.GetState().SetLineSelectMode()
|
|
||||||
self.context.GetState().AdjustSelectedLineIdx(self.context.GetViewTrait().PageDelta())
|
self.context.GetState().AdjustSelectedLineIdx(self.context.GetViewTrait().PageDelta())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -239,6 +239,7 @@ func (s *State) CurrentLineNumber() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *State) AdjustSelectedLineIdx(change int) {
|
func (s *State) AdjustSelectedLineIdx(change int) {
|
||||||
|
s.SetLineSelectMode()
|
||||||
s.SelectLine(s.selectedLineIdx + change)
|
s.SelectLine(s.selectedLineIdx + change)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user