chore(textarea,textinput/lint): use slices.Delete()

This commit is contained in:
Christian Rocha
2025-05-26 09:15:38 -04:00
parent b2bcf2232b
commit 0f113d10c4
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ package textinput
import (
"reflect"
"slices"
"strings"
"unicode"
@@ -624,7 +625,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
m.CursorStart()
case key.Matches(msg, m.KeyMap.DeleteCharacterForward):
if len(m.value) > 0 && m.pos < len(m.value) {
m.value = append(m.value[:m.pos], m.value[m.pos+1:]...)
m.value = slices.Delete(m.value, m.pos, m.pos+1)
m.Err = m.validate(m.value)
}
case key.Matches(msg, m.KeyMap.LineEnd):