Skip to content

REPL: IndexOutOfBoundsException with vi mode search #12535

Closed as not planned
Closed as not planned
@som-snytt

Description

@som-snytt

reproduction steps

  ~ scala -Xjline:vi
Welcome to Scala 2.13.8 (OpenJDK 64-Bit Server VM, Java 17.0.2).
Type in expressions for evaluation. Or try :help.

scala>
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: -6365, Size: 500
        at java.base/java.util.LinkedList.checkPositionIndex(LinkedList.java:564)
        at java.base/java.util.LinkedList.listIterator(LinkedList.java:871)
        at org.jline.reader.impl.history.DefaultHistory.iterator(DefaultHistory.java:442)
        at org.jline.reader.impl.LineReaderImpl.searchBackwards(LineReaderImpl.java:2842)
        at org.jline.reader.impl.LineReaderImpl.viRepeatSearch(LineReaderImpl.java:2037)
        at org.jline.reader.impl.LineReaderImpl.viHistorySearchBackward(LineReaderImpl.java:2029)
        at org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3778)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:679)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:468)
        at scala.tools.nsc.interpreter.jline.Reader.readOneLine(Reader.scala:44)
        at scala.tools.nsc.interpreter.shell.InteractiveReader.readLine(InteractiveReader.scala:38)
        at scala.tools.nsc.interpreter.shell.InteractiveReader.readLine$(InteractiveReader.scala:38)
        at scala.tools.nsc.interpreter.jline.Reader.readLine(Reader.scala:34)
        at scala.tools.nsc.interpreter.shell.ILoop.readOneLine(ILoop.scala:451)
        at scala.tools.nsc.interpreter.shell.ILoop.loop(ILoop.scala:456)
        at scala.tools.nsc.interpreter.shell.ILoop.run(ILoop.scala:968)
        at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:87)
        at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:91)
        at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:103)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:108)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

About to hit enter:

scala>
?util_

problem

They took away the history command and didn't tell me how to use jline history.

I tried something, but it looks broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions