Files
abra/vendor/github.com/charmbracelet/x/cellbuf/utils.go
decentral1se 7fb9675b1e
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
chore: golang 1.26 && make deps
2026-04-01 11:25:57 +02:00

25 lines
322 B
Go

package cellbuf
import (
"strings"
)
// Height returns the height of a string.
func Height(s string) int {
return strings.Count(s, "\n") + 1
}
func clamp(v, low, high int) int {
if high < low {
low, high = high, low
}
return min(high, max(low, v))
}
func abs(a int) int {
if a < 0 {
return -a
}
return a
}