Skip to content

Commit

Permalink
fix(textarea): Add deleteWordRight
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Jul 5, 2022
1 parent 2a2fb10 commit 3a34fc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,12 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
}
m.deleteWordLeft()
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):
if len(m.value) >= maxHeight {
return m, nil
Expand Down

0 comments on commit 3a34fc4

Please sign in to comment.