Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Work around flow analysis bug #59

Merged
merged 3 commits into from
Sep 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/src/highlighter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ class Highlighter {
? _primaryColor
: _secondaryColor;
var foundCurrent = false;
for (var highlight in highlightsByColumn) {
for (var tmp in highlightsByColumn) {
// Work around https://github.com/dart-lang/sdk/issues/43136
final highlight = tmp;
final startLine = highlight?.span.start.line;
final endLine = highlight?.span.end.line;
if (current != null && highlight == current) {
Expand Down Expand Up @@ -326,9 +328,9 @@ class Highlighter {
}, color: openedOnThisLineColor);
openedOnThisLine = true;
openedOnThisLineColor ??=
highlight!.isPrimary ? _primaryColor : _secondaryColor;
highlight.isPrimary ? _primaryColor : _secondaryColor;
} else if (endLine == line.number &&
highlight!.span.end.column == line.text.length) {
highlight.span.end.column == line.text.length) {
_buffer.write(highlight.label == null
? glyph.glyphOrAscii('└', '\\')
: vertical);
Expand Down