1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

allow changing tabs with [ and ]

This commit is contained in:
Jesse Duffield
2019-11-16 16:20:05 +11:00
parent 325408d0e3
commit 92e43d9e77
3 changed files with 35 additions and 0 deletions

View File

@ -299,3 +299,14 @@ func DifferenceInt(a, b []int) []int {
}
return result
}
// used to keep a number n between 0 and max, allowing for wraparounds
func ModuloWithWrap(n, max int) int {
if n >= max {
return n % max
} else if n < 0 {
return max + n
} else {
return n
}
}