fix(textarea): Add deleteWordRight

This commit is contained in:
Maas Lalani 2022-07-05 14:16:29 -04:00
parent 2a2fb10f5f
commit 3a34fc4ff8

View File

@ -752,6 +752,12 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
} }
m.deleteWordLeft() m.deleteWordLeft()
case key.Matches(msg, m.KeyMap.DeleteWordForward): case key.Matches(msg, m.KeyMap.DeleteWordForward):
m.col = clamp(m.col, 0, len(m.value[m.row]))
if m.col >= len(m.value[m.row]) {
m.mergeLineBelow(m.row)
break
}
m.deleteWordRight()
case key.Matches(msg, m.KeyMap.InsertNewline): case key.Matches(msg, m.KeyMap.InsertNewline):
if len(m.value) >= maxHeight { if len(m.value) >= maxHeight {
return m, nil return m, nil