Skip to content

Commit

Permalink
改行したい
Browse files Browse the repository at this point in the history
  • Loading branch information
szktkfm committed Mar 2, 2024
1 parent 0808ed2 commit cc1b688
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions cell.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package mdtt

import (
"strings"

"github.com/charmbracelet/bubbles/textarea"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
Expand Down Expand Up @@ -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
Expand All @@ -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))
}
Expand Down
1 change: 0 additions & 1 deletion table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cc1b688

Please sign in to comment.