Skip to content

Commit 3a34fc4

Browse files
committed
fix(textarea): Add deleteWordRight
1 parent 2a2fb10 commit 3a34fc4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

textarea/textarea.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,12 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
752752
}
753753
m.deleteWordLeft()
754754
case key.Matches(msg, m.KeyMap.DeleteWordForward):
755+
m.col = clamp(m.col, 0, len(m.value[m.row]))
756+
if m.col >= len(m.value[m.row]) {
757+
m.mergeLineBelow(m.row)
758+
break
759+
}
760+
m.deleteWordRight()
755761
case key.Matches(msg, m.KeyMap.InsertNewline):
756762
if len(m.value) >= maxHeight {
757763
return m, nil

0 commit comments

Comments
 (0)