We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cc5c83 commit 5c3bdd5Copy full SHA for 5c3bdd5
compiler/src/dotty/tools/repl/JLineTerminal.scala
@@ -87,8 +87,8 @@ final class JLineTerminal {
87
88
context match {
89
case ParseContext.ACCEPT_LINE =>
90
- // TODO: take into account cursor position
91
- if (ParseResult.isIncomplete(line)) incomplete()
+ val lastLineOffset = line.lastIndexOfSlice(System.lineSeparator)
+ if (cursor <= lastLineOffset || ParseResult.isIncomplete(line)) incomplete()
92
else parsedLine("", 0)
93
// using dummy values,
94
// resulting parsed line is probably unused
0 commit comments