Index: runtime/observatory/lib/src/elements/script_inset.dart |
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart |
index 92930a9eece56db3cb7c63e88fb68cde9ae1e31d..9900117fde3491fe223ed573c09a82ee3781c2ef 100644 |
--- a/runtime/observatory/lib/src/elements/script_inset.dart |
+++ b/runtime/observatory/lib/src/elements/script_inset.dart |
@@ -824,6 +824,11 @@ class ScriptInsetElement extends ObservatoryElement { |
return table; |
} |
+ var endLine = (endPos != null |
+ ? script.tokenToLine(endPos) |
+ : script.lines.length + script.lineOffset); |
+ var lineNumPad = endLine.toString().length; |
+ |
annotationsCursor = 0; |
int blankLineCount = 0; |
@@ -840,17 +845,17 @@ class ScriptInsetElement extends ObservatoryElement { |
if (blankLineCount < 4) { |
// Too few blank lines for an elipsis. |
for (int j = firstBlank; j <= lastBlank; j++) { |
- table.append(lineElement(script.getLine(j))); |
+ table.append(lineElement(script.getLine(j), lineNumPad)); |
} |
} else { |
// Add an elipsis for the skipped region. |
- table.append(lineElement(script.getLine(firstBlank))); |
- table.append(lineElement(null)); |
- table.append(lineElement(script.getLine(lastBlank))); |
+ table.append(lineElement(script.getLine(firstBlank), lineNumPad)); |
+ table.append(lineElement(null, lineNumPad)); |
+ table.append(lineElement(script.getLine(lastBlank), lineNumPad)); |
} |
blankLineCount = 0; |
} |
- table.append(lineElement(line)); |
+ table.append(lineElement(line, lineNumPad)); |
} |
} |
@@ -876,11 +881,11 @@ class ScriptInsetElement extends ObservatoryElement { |
return annotation; |
} |
- Element lineElement(ScriptLine line) { |
+ Element lineElement(ScriptLine line, int lineNumPad) { |
var e = new DivElement(); |
e.classes.add("sourceRow"); |
e.append(lineBreakpointElement(line)); |
- e.append(lineNumberElement(line)); |
+ e.append(lineNumberElement(line, lineNumPad)); |
e.append(lineSourceElement(line)); |
return e; |
} |
@@ -952,9 +957,9 @@ class ScriptInsetElement extends ObservatoryElement { |
return e; |
} |
- Element lineNumberElement(ScriptLine line) { |
+ Element lineNumberElement(ScriptLine line, int lineNumPad) { |
var lineNumber = line == null ? "..." : line.line; |
- var e = span("$nbsp$lineNumber$nbsp"); |
+ var e = span("$nbsp${lineNumber.toString().padLeft(lineNumPad,nbsp)}$nbsp"); |
Cutch
2015/10/14 19:12:41
if (lineNumPad == null) {
lineNumPad = 0;
}
turnidge
2015/10/14 19:23:13
Resolved offline.
|
e.classes.add('noCopy'); |
if (lineNumber == _currentLine) { |