mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
feat(tui): configurable keybinds and mouse scroll
This commit is contained in:
parent
d4157d9a96
commit
bd46cf0f86
19 changed files with 1276 additions and 853 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/charmbracelet/bubbles/v2/key"
|
||||
tea "github.com/charmbracelet/bubbletea/v2"
|
||||
"github.com/charmbracelet/lipgloss/v2"
|
||||
)
|
||||
|
||||
var Current *LayoutInfo
|
||||
|
@ -45,6 +46,13 @@ type Sizeable interface {
|
|||
GetSize() (int, int)
|
||||
}
|
||||
|
||||
type Alignable interface {
|
||||
MaxWidth() int
|
||||
Alignment() lipgloss.Position
|
||||
SetPosition(x, y int)
|
||||
GetPosition() (x, y int)
|
||||
}
|
||||
|
||||
func KeyMapToSlice(t any) (bindings []key.Binding) {
|
||||
typ := reflect.TypeOf(t)
|
||||
if typ.Kind() != reflect.Struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue