Skip to content

Commit

Permalink
feat(Vim Motion): multi line navigation support for motion E
Browse files Browse the repository at this point in the history
  • Loading branch information
IMOitself committed Oct 3, 2024
1 parent eda2017 commit fb7b66c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/main/java/imo/text/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer> nextWord = currLine.wordList.get(nextWordIndex);
int nextLastChar = nextWord.size() - 1;
Expand Down

0 comments on commit fb7b66c

Please sign in to comment.