fix(textarea): app would crash if deleteWordRight was called at the end of line (#313)

* fix(textarea): app would crash if deleteWordRight was called at the end
of line

* fix(textarea): deleteWordRight would work incorrectly

Co-authored-by: infastin <thecookied123@gmail.com>
This commit is contained in:
infastin
2023-01-23 13:10:21 -05:00
committed by GitHub
co-authored by infastin
parent 4a71cee5a1
commit a6a12c4a31
+2 -6
View File
@@ -623,14 +623,10 @@ func (m *Model) deleteWordRight() {
}
oldCol := m.col
m.SetCursor(m.col + 1)
for unicode.IsSpace(m.value[m.row][m.col]) {
for m.col < len(m.value[m.row]) && unicode.IsSpace(m.value[m.row][m.col]) {
// ignore series of whitespace after cursor
m.SetCursor(m.col + 1)
if m.col >= len(m.value[m.row]) {
break
}
}
for m.col < len(m.value[m.row]) {