remove arrow from current source line

pull/22966/head
Fedor Indutny 2011-09-20 15:18:05 +07:00 committed by Ryan Dahl
parent ff05beeef3
commit 4ff15512f5
1 changed files with 10 additions and 16 deletions

View File

@ -977,23 +977,17 @@ Interface.prototype.list = function() {
lines[i] = lines[i].slice(wrapper.length);
}
var breakpoint = client.breakpoints.some(function(bp) {
return bp.script === client.currentScript &&
bp.line == lineno;
});
var current = lineno == 1 + client.currentSourceLine,
breakpoint = client.breakpoints.some(function(bp) {
return bp.script === client.currentScript &&
bp.line == lineno;
}),
line = current ?
SourceUnderline(lines[i], client.currentSourceColumn)
:
lines[i];
if (lineno == 1 + client.currentSourceLine) {
var nchars = intChars(lineno),
pointer = breakpoint ? '*' : '=';
for (var j = 1; j < nchars - 1; j++) {
pointer += '=';
}
pointer += '>';
self.print(pointer + ' ' +
SourceUnderline(lines[i], client.currentSourceColumn));
} else {
self.print(leftPad(lineno, breakpoint && '*') + ' ' + lines[i]);
}
self.print(leftPad(lineno, breakpoint && '*') + ' ' + line);
}
self.resume();
});