mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
chore: cleanup
This commit is contained in:
parent
825c0b64af
commit
3944930fc0
3 changed files with 4 additions and 8 deletions
|
@ -243,7 +243,6 @@ func (m *editorCmp) SetSize(width, height int) tea.Cmd {
|
|||
m.height = height
|
||||
m.textarea.SetWidth(width - 3) // account for the prompt and padding right
|
||||
m.textarea.SetHeight(height)
|
||||
m.textarea.SetWidth(width)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -11,16 +11,16 @@ type Container interface {
|
|||
tea.Model
|
||||
Sizeable
|
||||
Bindings
|
||||
Focus() // Add focus method
|
||||
Blur() // Add blur method
|
||||
Focus()
|
||||
Blur()
|
||||
}
|
||||
|
||||
type container struct {
|
||||
width int
|
||||
height int
|
||||
|
||||
content tea.Model
|
||||
|
||||
// Style options
|
||||
paddingTop int
|
||||
paddingRight int
|
||||
paddingBottom int
|
||||
|
@ -32,7 +32,7 @@ type container struct {
|
|||
borderLeft bool
|
||||
borderStyle lipgloss.Border
|
||||
|
||||
focused bool // Track focus state
|
||||
focused bool
|
||||
}
|
||||
|
||||
func (c *container) Init() tea.Cmd {
|
||||
|
@ -152,16 +152,13 @@ func (c *container) Blur() {
|
|||
type ContainerOption func(*container)
|
||||
|
||||
func NewContainer(content tea.Model, options ...ContainerOption) Container {
|
||||
|
||||
c := &container{
|
||||
content: content,
|
||||
borderStyle: lipgloss.NormalBorder(),
|
||||
}
|
||||
|
||||
for _, option := range options {
|
||||
option(c)
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue