From 786f4e2de3ace8876796304c6f19b613b45ead52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Kivim=C3=A4ki?= Date: Fri, 26 Jan 2024 09:52:55 +0200 Subject: [PATCH] chore(survey): add todo about the max width --- pkg/ui/editable/model.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/ui/editable/model.go b/pkg/ui/editable/model.go index 3d5bd42b..4690a81f 100644 --- a/pkg/ui/editable/model.go +++ b/pkg/ui/editable/model.go @@ -22,6 +22,8 @@ type Model struct { focus bool optional bool + width int + styles Styles table *table.Table } @@ -228,6 +230,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if cmd != nil { return m, cmd } + case tea.WindowSizeMsg: + m.width = msg.Width } m.rows[m.cursorY][m.cursorX].input, cmd = m.rows[m.cursorY][m.cursorX].input.Update(msg) @@ -259,6 +263,8 @@ func (m Model) View() string { Data(m). Render()) + // TODO: Use m.width to manage the max width of the table + s.WriteRune('\n') if errs := m.Errors(); len(errs) != 0 { for _, err := range errs {