Skip to content

Commit

Permalink
JLine history file seems to grow without limit, fixes #642
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Jan 24, 2021
1 parent b092366 commit 91d2e33
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void load() throws IOException {
try (BufferedReader reader = Files.newBufferedReader(path)) {
internalClear();
reader.lines().forEach(line -> addHistoryLine(path, line));
setHistoryFileData(path, new HistoryFileData(items.size(), items.size()));
setHistoryFileData(path, new HistoryFileData(items.size(), offset + items.size()));
maybeResize();
}
}
Expand All @@ -105,7 +105,7 @@ public void read(Path file, boolean incremental) throws IOException {
Log.trace("Reading history from: ", path);
try (BufferedReader reader = Files.newBufferedReader(path)) {
reader.lines().forEach(line -> addHistoryLine(path, line, incremental));
setHistoryFileData(path, new HistoryFileData(items.size(), items.size()));
setHistoryFileData(path, new HistoryFileData(items.size(), offset + items.size()));
maybeResize();
}
}
Expand Down

0 comments on commit 91d2e33

Please sign in to comment.