Skip to content

Commit

Permalink
Builtin Less has an IndexOutOfBoundsException when seeking to the end…
Browse files Browse the repository at this point in the history
… of the file, fixes #860
  • Loading branch information
mattirn committed Aug 29, 2023
1 parent 77e9da7 commit bd95366
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtins/src/main/java/org/jline/builtins/Less.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002-2022, the original author(s).
* Copyright (c) 2002-2023, the original author(s).
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
Expand Down Expand Up @@ -1174,6 +1174,7 @@ void moveForward(int lines) throws IOException {
}
if (lines == Integer.MAX_VALUE) {
moveTo(Integer.MAX_VALUE);
firstLineToDisplay = height - 1;
for (int l = 0; l < height - 1; l++) {
firstLineToDisplay =
prevLine2display(firstLineToDisplay, dpCompiled).getU();
Expand Down

0 comments on commit bd95366

Please sign in to comment.