Skip to content

Commit 685a650

Browse files
author
Philip Guo
committed
remove top border on function call highlights
1 parent 3c2f4cd commit 685a650

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -812,20 +812,7 @@ ExecutionVisualizer.prototype.updateOutput = function() {
812812
/* if instrLimitReached, then treat like a normal non-terminating line */
813813
var isTerminated = (!myViz.instrLimitReached && isLastInstr);
814814

815-
// the highlighted line can either have a 'top' border, 'bottom'
816-
// border, or no border (null), depending on the value of 'borderType':
817-
var borderType = null;
818-
if (!hasError) {
819-
if (curEntry.event == 'return' || isTerminated) {
820-
borderType = 'bottom';
821-
}
822-
else {
823-
borderType = 'top';
824-
}
825-
}
826-
827815
var funcCallSiteLine = null;
828-
829816
// highlight the call site for a 'call' instruction
830817
if (curEntry.event == 'call' && myViz.curInstr > 0) {
831818
var prevEntry = myViz.curTrace[myViz.curInstr - 1];
@@ -839,6 +826,21 @@ ExecutionVisualizer.prototype.updateOutput = function() {
839826
funcReturnSiteLine = nextEntry.line;
840827
}
841828

829+
830+
// the highlighted line can either have a 'top' border, 'bottom'
831+
// border, or no border (null), depending on the value of 'borderType':
832+
var borderType = null;
833+
if (!hasError && !funcCallSiteLine) {
834+
if (curEntry.event == 'return' || isTerminated) {
835+
borderType = 'bottom';
836+
}
837+
else {
838+
borderType = 'top';
839+
}
840+
}
841+
842+
843+
842844
myViz.domRootD3.selectAll('#pyCodeOutputDiv td.lineNo')
843845
.attr('id', function(d) {return 'lineNo' + d.lineNumber;})
844846
.style('color', function(d)

0 commit comments

Comments
 (0)