mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
move more view model logic into the files view model
This commit is contained in:
@ -59,6 +59,15 @@ func Max(x, y int) int {
|
||||
return y
|
||||
}
|
||||
|
||||
func Clamp(x int, min int, max int) int {
|
||||
if x < min {
|
||||
return min
|
||||
} else if x > max {
|
||||
return max
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func AsJson(i interface{}) string {
|
||||
bytes, _ := json.MarshalIndent(i, "", " ")
|
||||
return string(bytes)
|
||||
|
Reference in New Issue
Block a user