forward_word in editor should move to the end of line

This commit is contained in:
mozbug 2020-02-27 23:47:04 +08:00
parent c6e1ed8c5c
commit c2e162613f

View file

@ -360,6 +360,8 @@ export const forward_word = wrap_input(
let boundaries = getWordBoundaries(text, selectionStart, false)
if (selectionStart >= boundaries[0] && selectionStart < boundaries[1])
boundaries = getWordBoundaries(text, boundaries[1], false)
if (selectionStart >= boundaries[0]) // last word
return [null, boundaries[1], null]
return [null, boundaries[0], null]
}),
)