Skip to content

Commit

Permalink
Fix multi-line REPL
Browse files Browse the repository at this point in the history
  • Loading branch information
ab5tract committed Nov 5, 2024
1 parent 3163e28 commit f9624c9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/org/raku/comma/repl/RakuReplConsole.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,11 @@ class RakuReplConsole(
}

override fun processLine(line: String) {
// Wrap in envelope for REPL backend.
val lines = line.split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
sendText(
"""
EVAL ${lines.size}
${java.lang.String.join("\n", *lines)}
""".trimIndent()
EVAL ${line.lines().size}
$line
""".trim() + "\n"
)

// Add this line to the history, (used for history and auto-complete).
Expand Down

0 comments on commit f9624c9

Please sign in to comment.