1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

support split view in staging panel and staging ranges

This commit is contained in:
Jesse Duffield
2019-10-30 20:23:25 +11:00
parent 081598d989
commit 820f3d5cbb
11 changed files with 410 additions and 185 deletions

View File

@ -233,18 +233,18 @@ func NextIndex(numbers []int, currentNumber int) int {
return index
}
}
return 0
return len(numbers) - 1
}
// PrevIndex returns the index that comes before the given number, cycling if we reach the end
func PrevIndex(numbers []int, currentNumber int) int {
end := len(numbers) - 1
for i := end; i >= 0; i -= 1 {
for i := end; i >= 0; i-- {
if numbers[i] < currentNumber {
return i
}
}
return end
return 0
}
func AsJson(i interface{}) string {