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

Unified Diff: dart/site/try/src/selection.dart

Issue 373563002: Handle multiline interpolated strings in line-based scanner. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
Index: dart/site/try/src/selection.dart
diff --git a/dart/site/try/src/selection.dart b/dart/site/try/src/selection.dart
index c0d606eb7d11ff4eb01d1c5e731a914b908cadb3..e458bae81b1e5d263c12579a38fb5bbecc96a393 100644
--- a/dart/site/try/src/selection.dart
+++ b/dart/site/try/src/selection.dart
@@ -42,7 +42,12 @@ class TrySelection {
[Decoration decoration]) {
if (start == end) return null;
- Text textNode = new Text(text.substring(start, end));
+ String substring = text.substring(start, end);
+ if (substring == '\n') {
+ // Don't add decorations to trailing newline.
+ decoration = null;
+ }
+ Text textNode = new Text(substring);
if (start <= globalOffset && globalOffset <= end) {
anchorNode = textNode;

Powered by Google App Engine
This is Rietveld 408576698