File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -395,13 +395,17 @@ class AnsiRepl is Repl {
395
395
System .write ("\r > " )
396
396
System .write (Color .none )
397
397
398
- // Syntax highlight the line.
399
- for (token in lex (line, true )) {
400
- if (token.type == Token .eof ) break
401
-
402
- System .write (TOKEN_COLORS[token.type])
403
- System .write (token.text)
404
- System .write (Color .none )
398
+ if (! Command .isCommand (line)) {
399
+ // Syntax highlight the line.
400
+ for (token in lex (line, true )) {
401
+ if (token.type == Token .eof ) break
402
+
403
+ System .write (TOKEN_COLORS[token.type])
404
+ System .write (token.text)
405
+ System .write (Color .none )
406
+ }
407
+ } else {
408
+ System .write (line)
405
409
}
406
410
407
411
if (showCompletion) {
Original file line number Diff line number Diff line change @@ -397,13 +397,17 @@ static const char* replModuleSource =
397
397
" System.write(\"\r > \" )\n "
398
398
" System.write(Color.none)\n "
399
399
" \n "
400
- " // Syntax highlight the line.\n "
401
- " for (token in lex(line, true)) {\n "
402
- " if (token.type == Token.eof) break\n "
403
- " \n "
404
- " System.write(TOKEN_COLORS[token.type])\n "
405
- " System.write(token.text)\n "
406
- " System.write(Color.none)\n "
400
+ " if (!Command.isCommand(line)) {\n "
401
+ " // Syntax highlight the line.\n "
402
+ " for (token in lex(line, true)) {\n "
403
+ " if (token.type == Token.eof) break\n "
404
+ " \n "
405
+ " System.write(TOKEN_COLORS[token.type])\n "
406
+ " System.write(token.text)\n "
407
+ " System.write(Color.none)\n "
408
+ " }\n "
409
+ " } else {\n "
410
+ " System.write(line)\n "
407
411
" }\n "
408
412
" \n "
409
413
" if (showCompletion) {\n "
You can’t perform that action at this time.
0 commit comments