Skip to content

Commit

Permalink
nano: added tab-character management, fixed if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Sep 28, 2019
1 parent 82b514e commit 23af0af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtins/src/main/java/org/jline/builtins/Nano.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void moveToChar(int pos, CursorMovement move) {
if (lines.get(line).contains("\t")) {
int cpos = charPosition(pos, move);
pos = new AttributedStringBuilder().tabs(tabs).append(lines.get(line)).columnLength();
if (cpos < pos) {
if (cpos < lines.get(line).length()) {
pos = new AttributedStringBuilder().tabs(tabs).append(lines.get(line).substring(0, cpos)).columnLength();
}
}
Expand Down

0 comments on commit 23af0af

Please sign in to comment.