@@ -7,7 +7,8 @@ import dotty.tools.dotc.printing.SyntaxHighlighting
7
7
import dotty .tools .dotc .reporting .Reporter
8
8
import dotty .tools .dotc .util .SourceFile
9
9
import org .jline .reader
10
- import org .jline .reader .LineReader .Option
10
+ import org .jline .reader .LineReader .Option ._
11
+ import org .jline .reader .LineReader ._
11
12
import org .jline .reader .Parser .ParseContext
12
13
import org .jline .reader ._
13
14
import org .jline .reader .impl .history .DefaultHistory
@@ -49,9 +50,10 @@ final class JLineTerminal extends java.io.Closeable {
49
50
.completer(completer)
50
51
.highlighter(new Highlighter )
51
52
.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
55
57
.build()
56
58
57
59
lineReader.readLine(prompt)
@@ -70,11 +72,14 @@ final class JLineTerminal extends java.io.Closeable {
70
72
/** Provide multi-line editing support */
71
73
private class Parser (implicit ctx : Context ) extends reader.Parser {
72
74
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
+ */
73
81
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
78
83
) extends reader.ParsedLine {
79
84
// Using dummy values, not sure what they are used for
80
85
def wordIndex = - 1
0 commit comments