1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-02 09:21:40 +02:00

Select next stageable line correctly after staging a range of lines

We already have this very convenient behavior of jumping to the next stageable
line after staging something. However, while this worked well for staging
single lines or hunks, it didn't work correctly when staging a range of lines;
in this case we want to start searching from the first line of the range.
This commit is contained in:
stk 2023-02-14 09:43:22 +01:00
parent 97daec7228
commit b499eba1a8
2 changed files with 2 additions and 4 deletions

View File

@ -200,7 +200,8 @@ func (self *StagingController) applySelection(reverse bool) error {
}
if state.SelectingRange() {
state.SetLineSelectMode()
firstLine, _ := state.SelectedRange()
state.SelectLine(firstLine)
}
return nil

View File

@ -34,9 +34,6 @@ var StageRangeOfLines = NewIntegrationTest(NewIntegrationTestArgs{
Content(
Contains(" 3rd\n 4th\n-5th\n+5th changed\n 6th"),
).
/* EXPECTED:
SelectedLine(Equals("-5th"))
ACTUAL */
SelectedLine(Equals("+5th changed"))
},
})