diff --git a/app/src/main/java/imo/text/Editor.java b/app/src/main/java/imo/text/Editor.java index 3f1b0bf..3c244e7 100644 --- a/app/src/main/java/imo/text/Editor.java +++ b/app/src/main/java/imo/text/Editor.java @@ -195,7 +195,15 @@ void moveCursorToNextWordEnd(){ } int nextWordIndex = currWordIndex + 1; - if(nextWordIndex > currLine.wordList.size() - 1) return; // over last word + if(nextWordIndex >= currLine.wordList.size()) { // over last word of the line + int nextLinePosition = currLinePosition + 1; + if(nextLinePosition >= Lines.size()) return; + + currLine = Lines.get(nextLinePosition); + nextWordIndex = 0; + currLinePosition = nextLinePosition; + + } List nextWord = currLine.wordList.get(nextWordIndex); int nextLastChar = nextWord.size() - 1;