diff options
| author | Kujtim Hoxha <[email protected]> | 2025-04-21 13:33:51 +0200 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-04-21 13:42:29 +0200 |
| commit | e7bb99baab5e6968ce0351d6ad219ed21ceec4df (patch) | |
| tree | 01bee64956837d810a61938bef0f70af006ca4f1 /internal/tui/components | |
| parent | 1da298e7554bab0f7a631a44fed12692d668c024 (diff) | |
| download | opencode-e7bb99baab5e6968ce0351d6ad219ed21ceec4df.tar.gz opencode-e7bb99baab5e6968ce0351d6ad219ed21ceec4df.zip | |
fix the memory bug
Diffstat (limited to 'internal/tui/components')
| -rw-r--r-- | internal/tui/components/chat/list.go | 1 | ||||
| -rw-r--r-- | internal/tui/components/core/status.go | 15 |
2 files changed, 13 insertions, 3 deletions
diff --git a/internal/tui/components/chat/list.go b/internal/tui/components/chat/list.go index b09cc4495..03a50541e 100644 --- a/internal/tui/components/chat/list.go +++ b/internal/tui/components/chat/list.go @@ -370,6 +370,7 @@ func (m *messagesCmp) SetSize(width, height int) tea.Cmd { delete(m.cachedContent, msg.ID) } m.uiMessages = make([]uiMessage, 0) + m.renderView() return nil } diff --git a/internal/tui/components/core/status.go b/internal/tui/components/core/status.go index 5a2114e83..8bf3e5166 100644 --- a/internal/tui/components/core/status.go +++ b/internal/tui/components/core/status.go @@ -18,6 +18,11 @@ import ( "github.com/kujtimiihoxha/opencode/internal/tui/util" ) +type StatusCmp interface { + tea.Model + SetHelpMsg(string) +} + type statusCmp struct { info util.InfoMsg width int @@ -146,7 +151,7 @@ func (m *statusCmp) projectDiagnostics() string { break } } - + // If any server is initializing, show that status if initializing { return lipgloss.NewStyle(). @@ -154,7 +159,7 @@ func (m *statusCmp) projectDiagnostics() string { Foreground(styles.Peach). Render(fmt.Sprintf("%s Initializing LSP...", styles.SpinnerIcon)) } - + errorDiagnostics := []protocol.Diagnostic{} warnDiagnostics := []protocol.Diagnostic{} hintDiagnostics := []protocol.Diagnostic{} @@ -235,7 +240,11 @@ func (m statusCmp) model() string { return styles.Padded.Background(styles.Grey).Foreground(styles.Text).Render(model.Name) } -func NewStatusCmp(lspClients map[string]*lsp.Client) tea.Model { +func (m statusCmp) SetHelpMsg(s string) { + helpWidget = styles.Padded.Background(styles.Forground).Foreground(styles.BackgroundDarker).Bold(true).Render(s) +} + +func NewStatusCmp(lspClients map[string]*lsp.Client) StatusCmp { return &statusCmp{ messageTTL: 10 * time.Second, lspClients: lspClients, |
