mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-09 06:36:10 +00:00
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:
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user