diff options
| author | Kujtim Hoxha <[email protected]> | 2025-03-23 14:56:32 +0100 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-03-23 15:00:12 +0100 |
| commit | 7844cacb257b14087bcb12764466ee0eeeb1921b (patch) | |
| tree | ccc9df7140e38e9fa55d190fc9e9f294e3987583 /internal/tui/layout | |
| parent | 4b0ea68d7af9a6031a7ffda7ad66e0cb83315750 (diff) | |
| download | opencode-7844cacb257b14087bcb12764466ee0eeeb1921b.tar.gz opencode-7844cacb257b14087bcb12764466ee0eeeb1921b.zip | |
add help
Diffstat (limited to 'internal/tui/layout')
| -rw-r--r-- | internal/tui/layout/bento.go | 10 | ||||
| -rw-r--r-- | internal/tui/layout/single.go | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/internal/tui/layout/bento.go b/internal/tui/layout/bento.go index 7d4c070df..8d1f1d10f 100644 --- a/internal/tui/layout/bento.go +++ b/internal/tui/layout/bento.go @@ -72,11 +72,11 @@ func (b *bentoLayout) GetSize() (int, int) { return b.width, b.height } -func (b bentoLayout) Init() tea.Cmd { +func (b *bentoLayout) Init() tea.Cmd { return nil } -func (b bentoLayout) Update(msg tea.Msg) (tea.Model, tea.Cmd) { +func (b *bentoLayout) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.WindowSizeMsg: b.SetSize(msg.Width, msg.Height) @@ -106,7 +106,7 @@ func (b bentoLayout) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return b, nil } -func (b bentoLayout) View() string { +func (b *bentoLayout) View() string { if b.width <= 0 || b.height <= 0 { return "" } @@ -310,14 +310,14 @@ func NewBentoLayout(panes BentoPanes, opts ...BentoLayoutOption) BentoLayout { p := make(map[paneID]SinglePaneLayout, len(panes)) for id, pane := range panes { // Wrap any pane that is not a SinglePaneLayout in a SinglePaneLayout - if _, ok := pane.(SinglePaneLayout); !ok { + if sp, ok := pane.(SinglePaneLayout); !ok { p[id] = NewSinglePane( pane, WithSinglePaneFocusable(true), WithSinglePaneBordered(true), ) } else { - p[id] = pane.(SinglePaneLayout) + p[id] = sp } } if len(p) == 0 { diff --git a/internal/tui/layout/single.go b/internal/tui/layout/single.go index 230e45458..b8168225f 100644 --- a/internal/tui/layout/single.go +++ b/internal/tui/layout/single.go @@ -30,11 +30,11 @@ type singlePaneLayout struct { type SinglePaneOption func(*singlePaneLayout) -func (s singlePaneLayout) Init() tea.Cmd { +func (s *singlePaneLayout) Init() tea.Cmd { return s.content.Init() } -func (s singlePaneLayout) Update(msg tea.Msg) (tea.Model, tea.Cmd) { +func (s *singlePaneLayout) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.WindowSizeMsg: s.SetSize(msg.Width, msg.Height) @@ -45,7 +45,7 @@ func (s singlePaneLayout) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return s, cmd } -func (s singlePaneLayout) View() string { +func (s *singlePaneLayout) View() string { style := lipgloss.NewStyle().Width(s.width).Height(s.height) if s.bordered { style = style.Width(s.width).Height(s.height) |
