mirror of
https://github.com/charmbracelet/bubbles.git
synced 2026-07-22 11:39:28 -06:00
chore(textarea): lift an if condition into a parent loop
This commit is contained in:
parent
c30c185b93
commit
a9344b5953
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user