diff options
| author | Kujtim Hoxha <[email protected]> | 2025-03-23 19:19:08 +0100 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-03-23 19:19:08 +0100 |
| commit | 8daa6e774a6e02698c90392e7b2008542f789594 (patch) | |
| tree | 8053fc1a4de87fc8dc3fd6e776577b0221c02ac5 /internal/tui/util | |
| parent | 796bbf4d66c0fc70e750c7f582019cb9a7298e59 (diff) | |
| download | opencode-8daa6e774a6e02698c90392e7b2008542f789594.tar.gz opencode-8daa6e774a6e02698c90392e7b2008542f789594.zip | |
add initial stuff
Diffstat (limited to 'internal/tui/util')
| -rw-r--r-- | internal/tui/util/util.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/tui/util/util.go b/internal/tui/util/util.go index fd1c4e818..fa3782843 100644 --- a/internal/tui/util/util.go +++ b/internal/tui/util/util.go @@ -16,3 +16,10 @@ type ( InfoMsg string ErrorMsg error ) + +func Clamp(v, low, high int) int { + if high < low { + low, high = high, low + } + return min(high, max(low, v)) +} |
