diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-12-23 21:32:34 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-12-30 12:35:12 +0300 |
commit | 74cc021ec289d1f61cc9b6a2b5528d2d0e8650e4 (patch) | |
tree | dc5aab55863bfaa21641c1eefd773020de7827fd /lib | |
parent | 080daf9ddddc05c4ed9efc3e37fac7d52fb9fb17 (diff) |
highlight current script
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_debugger.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js index 0dd3b93144b..d8b7c92295c 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -121,6 +121,7 @@ function Client() { this.currentFrame = 0; this.currentSourceLine = -1; + this.currentSource = null; // Note that 'Protocol' requires strings instead of Buffers. socket.setEncoding('utf8'); @@ -350,13 +351,17 @@ function startInterface() { term.prompt(); }); - } else if (cmd == 'scripts') { + } else if (cmd == 'scripts' || cmd == 'scripts full') { c.reqScripts(function (res) { if (/full/.test(cmd)) { console.log(res); } else { - var text = res.map(function (x) { return x.text; }); - console.log(text.join('\n')); + var text = ''; + for (var i = 0; i < res.length; i++) { + text += res[i].name == c.currentScript ? '* ' : ' '; + text += res[i].name + '\n'; + } + process.stdout.write(text); } term.prompt(); }); @@ -435,6 +440,7 @@ function startInterface() { c.currentSourceLine = res.body.sourceLine; c.currentFrame = 0; + c.currentScript = res.body.script.name; console.log(result); |