chore(textarea): lift an if condition into a parent loop

This commit is contained in:
Christian Rocha 2024-07-17 09:02:38 -04:00
parent c30c185b93
commit a9344b5953

View File

@ -767,10 +767,7 @@ func (m *Model) wordRight() {
func (m *Model) doWordRight(fn func(charIdx int, pos int)) {
// Skip spaces forward.
for {
if m.col < len(m.value[m.row]) && !unicode.IsSpace(m.value[m.row][m.col]) {
break
}
for m.col >= len(m.value[m.row]) || unicode.IsSpace(m.value[m.row][m.col]) {
if m.row == len(m.value)-1 && m.col == len(m.value[m.row]) {
// End of text.
break