@@ -7,7 +7,8 @@ import dotty.tools.dotc.printing.SyntaxHighlighting
77import dotty .tools .dotc .reporting .Reporter
88import dotty .tools .dotc .util .SourceFile
99import org .jline .reader
10- import org .jline .reader .LineReader .Option
10+ import org .jline .reader .LineReader .Option ._
11+ import org .jline .reader .LineReader ._
1112import org .jline .reader .Parser .ParseContext
1213import org .jline .reader ._
1314import org .jline .reader .impl .history .DefaultHistory
@@ -49,9 +50,10 @@ final class JLineTerminal extends java.io.Closeable {
4950 .completer(completer)
5051 .highlighter(new Highlighter )
5152 .parser(new Parser )
52- .variable(LineReader .SECONDARY_PROMPT_PATTERN , " %M" )
53- .option(Option .INSERT_TAB , true ) // at the beginning of the line, insert tab instead of completing
54- .option(Option .AUTO_FRESH_LINE , true ) // if not at start of line before prompt, move to new line
53+ .variable(SECONDARY_PROMPT_PATTERN , " %M" )
54+ .variable(LIST_MAX , 400 ) // ask user when number of completions exceed this limit (default is 100)
55+ .option(INSERT_TAB , true ) // at the beginning of the line, insert tab instead of completing
56+ .option(AUTO_FRESH_LINE , true ) // if not at start of line before prompt, move to new line
5557 .build()
5658
5759 lineReader.readLine(prompt)
@@ -70,11 +72,14 @@ final class JLineTerminal extends java.io.Closeable {
7072 /** Provide multi-line editing support */
7173 private class Parser (implicit ctx : Context ) extends reader.Parser {
7274
75+ /**
76+ * @param cursor The cursor position within the line
77+ * @param line The unparsed line
78+ * @param word The current word being completed
79+ * @param wordCursor The cursor position within the current word
80+ */
7381 private class ParsedLine (
74- val cursor : Int , // The cursor position within the line
75- val line : String , // The unparsed line
76- val word : String , // The current word being completed
77- val wordCursor : Int // The cursor position within the current word
82+ val cursor : Int , val line : String , val word : String , val wordCursor : Int
7883 ) extends reader.ParsedLine {
7984 // Using dummy values, not sure what they are used for
8085 def wordIndex = - 1
0 commit comments