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

Unified Diff: lib/src/chunk.dart

Issue 1180443003: Don't allow inline block comments to eat pending newlines. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Add a test. Created 5 years, 6 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 | lib/src/chunk_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/chunk.dart
diff --git a/lib/src/chunk.dart b/lib/src/chunk.dart
index c82db450ad78590978b92ec7775beb57e66cd8ed..d6f94651ff5655dc66eda41b4dce4d9e55b75e88 100644
--- a/lib/src/chunk.dart
+++ b/lib/src/chunk.dart
@@ -335,7 +335,7 @@ class SourceComment extends Selection {
/// and the beginning of this one.
///
/// Will be zero if the comment is a trailing one.
- final int linesBefore;
+ int linesBefore;
/// Whether this comment is a line comment.
final bool isLineComment;
@@ -347,6 +347,9 @@ class SourceComment extends Selection {
/// re-indented.
final bool isStartOfLine;
+ /// Whether this comment is an inline block comment.
+ bool get isInline => linesBefore == 0 && !isLineComment;
+
SourceComment(this.text, this.linesBefore,
{this.isLineComment, this.isStartOfLine});
}
« no previous file with comments | « no previous file | lib/src/chunk_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698