fix(textarea): ActionChange + e should also delete end of word

This commit is contained in:
Maas Lalani 2022-08-11 16:46:33 -04:00
parent 907f5e659d
commit 3e1a14200c
No known key found for this signature in database
GPG Key ID: 5A6ED5CBF1A0A000

View File

@ -437,7 +437,7 @@ func (m *Model) normalUpdate(msg tea.Msg) tea.Cmd {
return executeCmd(*m.command) return executeCmd(*m.command)
case "e", "E": case "e", "E":
end := m.findWordEndRight(max(m.command.Count, 1), msg.String() == "E") end := m.findWordEndRight(max(m.command.Count, 1), msg.String() == "E")
if m.command.Action == ActionDelete { if m.command.Action == ActionDelete || m.command.Action == ActionChange {
end.Col = min(end.Col+1, len(m.value[end.Row])) end.Col = min(end.Col+1, len(m.value[end.Row]))
} }
m.command.Range = Range{ m.command.Range = Range{