jline / jline3

JLine is a Java library for handling console input.
Other
1.49k stars 218 forks source link

i-search crashes with default setup #58

Closed electrum closed 7 years ago

electrum commented 7 years ago

Using the default LineReader setup, typing any character in i-search (ctrl-S) crashes:


java.lang.IndexOutOfBoundsException: Index: -1, Size: 0
        at java.util.LinkedList.checkPositionIndex(LinkedList.java:560)
        at java.util.LinkedList.listIterator(LinkedList.java:867)
        at org.jline.reader.impl.history.DefaultHistory.iterator(DefaultHistory.java:283)
        at org.jline.reader.impl.LineReaderImpl.searchForwards(LineReaderImpl.java:2415)
        at org.jline.reader.impl.LineReaderImpl.doSearchHistory(LineReaderImpl.java:2255)
        at org.jline.reader.impl.LineReaderImpl.historyIncrementalSearchForward(LineReaderImpl.java:2188)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:533)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:388)
        at org.acz.jless.Main.main(Main.java:53)
gnodet commented 7 years ago

Ok, that happens when the history is empty.