1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-13 01:30:53 +02:00

fixup! Move to next stageable line after adding a line to a custom patch

This commit is contained in:
Stefan Haller
2025-07-02 15:09:42 +02:00
parent 27ce820442
commit b8ac8d12e6
3 changed files with 26 additions and 12 deletions

View File

@ -325,8 +325,10 @@ func wrapPatchLines(diff string, view *gocui.View) ([]int, []int) {
return viewLineIndices, patchLineIndices
}
func (s *State) SelectNextStageableLine() {
func (s *State) SelectNextStageableLineOfSameIncludedState(includedLines []int, included bool) {
_, lastLineIdx := s.SelectedPatchRange()
patchLineIdx := s.patch.GetNextChangeIdx(lastLineIdx + 1)
s.SelectLine(s.viewLineIndices[patchLineIdx])
patchLineIdx, found := s.patch.GetNextChangeIdxOfSameIncludedState(lastLineIdx+1, includedLines, included)
if found {
s.SelectLine(s.viewLineIndices[patchLineIdx])
}
}