mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
chore: cleanup
This commit is contained in:
@@ -243,7 +243,6 @@ func (m *editorCmp) SetSize(width, height int) tea.Cmd {
|
|||||||
m.height = height
|
m.height = height
|
||||||
m.textarea.SetWidth(width - 3) // account for the prompt and padding right
|
m.textarea.SetWidth(width - 3) // account for the prompt and padding right
|
||||||
m.textarea.SetHeight(height)
|
m.textarea.SetHeight(height)
|
||||||
m.textarea.SetWidth(width)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,16 +11,16 @@ type Container interface {
|
|||||||
tea.Model
|
tea.Model
|
||||||
Sizeable
|
Sizeable
|
||||||
Bindings
|
Bindings
|
||||||
Focus() // Add focus method
|
Focus()
|
||||||
Blur() // Add blur method
|
Blur()
|
||||||
}
|
}
|
||||||
|
|
||||||
type container struct {
|
type container struct {
|
||||||
width int
|
width int
|
||||||
height int
|
height int
|
||||||
|
|
||||||
content tea.Model
|
content tea.Model
|
||||||
|
|
||||||
// Style options
|
|
||||||
paddingTop int
|
paddingTop int
|
||||||
paddingRight int
|
paddingRight int
|
||||||
paddingBottom int
|
paddingBottom int
|
||||||
@@ -32,7 +32,7 @@ type container struct {
|
|||||||
borderLeft bool
|
borderLeft bool
|
||||||
borderStyle lipgloss.Border
|
borderStyle lipgloss.Border
|
||||||
|
|
||||||
focused bool // Track focus state
|
focused bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *container) Init() tea.Cmd {
|
func (c *container) Init() tea.Cmd {
|
||||||
@@ -152,16 +152,13 @@ func (c *container) Blur() {
|
|||||||
type ContainerOption func(*container)
|
type ContainerOption func(*container)
|
||||||
|
|
||||||
func NewContainer(content tea.Model, options ...ContainerOption) Container {
|
func NewContainer(content tea.Model, options ...ContainerOption) Container {
|
||||||
|
|
||||||
c := &container{
|
c := &container{
|
||||||
content: content,
|
content: content,
|
||||||
borderStyle: lipgloss.NormalBorder(),
|
borderStyle: lipgloss.NormalBorder(),
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, option := range options {
|
for _, option := range options {
|
||||||
option(c)
|
option(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user