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

Unified Diff: pkg/analyzer/lib/src/services/formatter_impl.dart

Issue 477373002: Improve formatting of variable declarations/assignments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | pkg/analyzer/lib/src/services/writer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/services/formatter_impl.dart
diff --git a/pkg/analyzer/lib/src/services/formatter_impl.dart b/pkg/analyzer/lib/src/services/formatter_impl.dart
index efdeaf6383ca9f16de69a7a2239dd6c71bac7b85..2f7b9ce33c0bad5ac5fd158f0048fd672a8f490a 100644
--- a/pkg/analyzer/lib/src/services/formatter_impl.dart
+++ b/pkg/analyzer/lib/src/services/formatter_impl.dart
@@ -457,7 +457,7 @@ class SourceVisitor implements AstVisitor {
space();
token(node.operator);
allowContinuedLines((){
- space();
+ levelSpace(SINGLE_SPACE_WEIGHT);
visit(node.rightHandSide);
});
}
@@ -1368,14 +1368,9 @@ class SourceVisitor implements AstVisitor {
levelSpace(lastSpaceWeight);
visit(initializer);
});
- } else if (initializer is ConditionalExpression) {
- allowContinuedLines(() {
- space();
- visit(initializer);
- });
} else {
allowContinuedLines(() {
- levelSpace(lastSpaceWeight++);
+ levelSpace(SINGLE_SPACE_WEIGHT);
visit(initializer);
});
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/services/writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698