From cc1b68879ccefa5a88c4d871f4c9f9c3415c6239 Mon Sep 17 00:00:00 2001 From: szktkfm Date: Sat, 2 Mar 2024 22:24:16 +0900 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=A1=8C=E3=81=97=E3=81=9F=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cell.go | 7 ++----- table.go | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cell.go b/cell.go index 59eaac7..159f45f 100644 --- a/cell.go +++ b/cell.go @@ -1,8 +1,6 @@ package mdtt import ( - "strings" - "github.com/charmbracelet/bubbles/textarea" "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" @@ -46,8 +44,6 @@ func (m Cell) Update(msg tea.Msg) (Cell, tea.Cmd) { // h := m.textInput.LineInfo().Height // fmt.Println(h) - h := strings.Count(m.textInput.Value(), "\n") + 1 - m.textInput.SetHeight(h) switch msg := msg.(type) { // We handle errors just like any other message @@ -57,7 +53,8 @@ func (m Cell) Update(msg tea.Msg) (Cell, tea.Cmd) { } m.textInput, cmd = m.textInput.Update(msg) - + // h := strings.Count(m.textInput.Value(), "\n") + 1 + // m.textInput.SetHeight(h) width := runewidth.StringWidth(m.textInput.Value()) return m, tea.Batch(cmd, updateWidthCmd(width)) } diff --git a/table.go b/table.go index ec92552..4705fa7 100644 --- a/table.go +++ b/table.go @@ -666,7 +666,6 @@ func (m *TableModel) renderRow(rowID int) string { var value string if isInsertMode && isSelected { value = cell.View() - // value = cell.Value() } else { value = cell.Value() log.Debug("value", "value", value)