Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1057793003: Fix missing annotations in script inset when first annotation is outside the subset of lines being … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 024d1602ab4b64b9753df9c3b9be8af78fa0db19..41b5bd3f90eefdb33f5e948eafc4ea61613ec7d7 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -416,6 +416,16 @@ class ScriptInsetElement extends ObservatoryElement {
Annotation nextAnnotationOnLine(int line) {
if (annotationsCursor >= annotations.length) return null;
var annotation = annotations[annotationsCursor];
+
+ // Fast-forward past any annotations before the first line that
+ // we are displaying.
+ while (annotation.line < line) {
+ annotationsCursor++;
+ if (annotationsCursor >= annotations.length) return null;
+ annotation = annotations[annotationsCursor];
+ }
+
+ // Next annotation is for a later line, don't advance past it.
if (annotation.line != line) return null;
annotationsCursor++;
return annotation;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698