You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privatepartialdefspaceUptoLine' : List WorkGroup → Nat → Nat → SpaceResult
151
171
| [], _, _ => {}
152
172
| { items := [], .. }::gs, col, w => spaceUptoLine' gs col w
153
173
| g@{ items := i::is, .. }::gs, col, w =>
154
174
merge w
155
-
(spaceUptoLine i.f g.flatten (w + col - i.indent) w)
175
+
(spaceUptoLine i.f g.fld.shouldFlatten (w + col - i.indent) w)
156
176
(spaceUptoLine' ({ g with items := is }::gs) col)
157
177
158
178
/-- A monad in which we can pretty-print `Format` objects. -/
@@ -169,11 +189,11 @@ open MonadPrettyFormat
169
189
privatedefpushGroup (flb : FlattenBehavior) (items : List WorkItem) (gs : List WorkGroup) (w : Nat) [Monad m] [MonadPrettyFormat m] : m (List WorkGroup) := do
170
190
let k ← currColumn
171
191
-- Flatten group if it + the remainder (gs) fits in the remaining space. For `fill`, measure only up to the next (ungrouped) line break.
172
-
let g := { flatten := flb == FlattenBehavior.allOrNone, flb := flb, items := items : WorkGroup }
192
+
let g := { fld := .allow (flb == FlattenBehavior.allOrNone), flb := flb, items := items : WorkGroup }
173
193
let r := spaceUptoLine' [g] k (w-k)
174
194
let r' := merge (w-k) r (spaceUptoLine' gs k)
175
195
-- Prevent flattening if any item contains a hard line break, except within `fill` if it is ungrouped (=> unflattened)
0 commit comments