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

Unified Diff: lib/src/source_visitor.dart

Issue 1255703002: Don't force for fully split if initializers or updaters do. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 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
« no previous file with comments | « CHANGELOG.md ('k') | test/regression/0300/0375.stmt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/source_visitor.dart
diff --git a/lib/src/source_visitor.dart b/lib/src/source_visitor.dart
index dbeb1fd87c861df6ebd6058cde43e8269a9ad5c3..42897b8666cf8d5e514774d1ad2e01af17a23314 100644
--- a/lib/src/source_visitor.dart
+++ b/lib/src/source_visitor.dart
@@ -849,6 +849,9 @@ class SourceVisitor implements AstVisitor {
// as the rest of the loop clauses.
builder.indent(Indent.loopVariable);
+ // Allow the variables to stay unsplit even if the clauses split.
+ builder.startRule();
+
var declaration = node.variables;
visitDeclarationMetadata(declaration.metadata);
modifier(declaration.keyword);
@@ -858,6 +861,7 @@ class SourceVisitor implements AstVisitor {
split();
});
+ builder.endRule();
builder.unindent();
}
@@ -871,7 +875,13 @@ class SourceVisitor implements AstVisitor {
// The update clause.
if (node.updaters.isNotEmpty) {
split();
+
+ // Allow the updates to stay unsplit even if the clauses split.
+ builder.startRule();
+
visitCommaSeparatedNodes(node.updaters, between: split);
+
+ builder.endRule();
}
token(node.rightParenthesis);
« no previous file with comments | « CHANGELOG.md ('k') | test/regression/0300/0375.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698