|
|
@ -633,7 +633,7 @@ function SourceUnderline(sourceText, position) { |
|
|
|
|
|
|
|
// Colourize char if stdout supports colours
|
|
|
|
if (process.stdout.isTTY) { |
|
|
|
tail = tail.replace(/(.{1,}?)([^\w]|$)/, '\033[32m$1\033[39m$2'); |
|
|
|
tail = tail.replace(/(.+?)([^\w]|$)/, '\033[32m$1\033[39m$2'); |
|
|
|
} |
|
|
|
|
|
|
|
// Return source line with coloured char at `position`
|
|
|
@ -689,12 +689,13 @@ function Interface() { |
|
|
|
ignored = ['pause', 'resume', 'exitRepl', 'handleBreak', |
|
|
|
'requireConnection', 'killChild', 'trySpawn', |
|
|
|
'controlEval', 'debugEval', 'print', 'childPrint'], |
|
|
|
synonym = { |
|
|
|
shortcut = { |
|
|
|
'run': 'r', |
|
|
|
'cont': 'c', |
|
|
|
'next': 'n', |
|
|
|
'step': 's', |
|
|
|
'out': 'o' |
|
|
|
'out': 'o', |
|
|
|
'backtrace': 'bt' |
|
|
|
}; |
|
|
|
|
|
|
|
function defineProperty(key, protoKey) { |
|
|
@ -712,7 +713,7 @@ function Interface() { |
|
|
|
for (var i in proto) { |
|
|
|
if (proto.hasOwnProperty(i) && ignored.indexOf(i) === -1) { |
|
|
|
defineProperty(i, i); |
|
|
|
if (synonym[i]) defineProperty(synonym[i], i); |
|
|
|
if (shortcut[i]) defineProperty(shortcut[i], i); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|