mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
wip: refactoring tui
This commit is contained in:
parent
0b565b18c4
commit
01050a430f
60 changed files with 115 additions and 115 deletions
18
packages/tui/internal/util/util.go
Normal file
18
packages/tui/internal/util/util.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
func CmdHandler(msg tea.Msg) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
return msg
|
||||
}
|
||||
}
|
||||
|
||||
func Clamp(v, low, high int) int {
|
||||
if high < low {
|
||||
low, high = high, low
|
||||
}
|
||||
return min(high, max(low, v))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue