We aggressively merge lines if they fit, even if those lines are very complex:
select a, b, c, case when a > b then c else a end as d from e where a > 1 and b > 2
I'm not sure this is a good idea. The example above has 3 top-level segments (select, from, where) and the select segment has 4 segments. Maybe we should check the number of segments (either after we split into segments or before merging them) and skip merging across segments if there are more than N (where N is probably 3-4).
We aggressively merge lines if they fit, even if those lines are very complex:
I'm not sure this is a good idea. The example above has 3 top-level segments (select, from, where) and the
selectsegment has 4 segments. Maybe we should check the number of segments (either after we split into segments or before merging them) and skip merging across segments if there are more than N (where N is probably 3-4).