mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-06 09:24:55 +01:00
chore: rework layout primitives
This commit is contained in:
@@ -22,7 +22,7 @@ import (
|
||||
type EditorComponent interface {
|
||||
tea.Model
|
||||
tea.ViewModel
|
||||
layout.Sizeable
|
||||
SetSize(width, height int) tea.Cmd
|
||||
Content() string
|
||||
Lines() int
|
||||
Value() string
|
||||
@@ -158,7 +158,15 @@ func (m *editorComponent) Content() string {
|
||||
|
||||
func (m *editorComponent) View() string {
|
||||
if m.Lines() > 1 {
|
||||
return ""
|
||||
t := theme.CurrentTheme()
|
||||
return lipgloss.Place(
|
||||
m.width,
|
||||
m.height,
|
||||
lipgloss.Center,
|
||||
lipgloss.Center,
|
||||
"",
|
||||
styles.WhitespaceStyle(t.Background()),
|
||||
)
|
||||
}
|
||||
return m.Content()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user