Skip to content

Commit

Permalink
nano: insert/backspace operations ensure cursor in visible
Browse files Browse the repository at this point in the history
area, fixes #426
  • Loading branch information
mattirn committed Jul 30, 2019
1 parent 9667327 commit 4e4969c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtins/src/main/java/org/jline/builtins/Nano.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void insert(String insert) {
offsets.add(line, computeOffsets(ins.get(i)));
}
moveToChar(ins.get(ins.size() - 1).length() - (text.length() - pos));
ensureCursorVisible();
dirty = true;
}

Expand Down Expand Up @@ -345,6 +346,7 @@ boolean backspace(int count) {
dirty = true;
}
}
ensureCursorVisible();
return true;
}

Expand Down

0 comments on commit 4e4969c

Please sign in to comment.