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
Move open group token past ifstmt's if token to avoid extra newlines.
The implementation of consistent groups forces breaking inside of the group if the group starts at the beginning of a line (i.e. was immediately preceded by a break that fired). That isn't exactly what we want for if-stmt because the stmt generally starts at the beginning of a line and we want the breaks to fire only if the group is longer than the rest of the line.
Moving the open token past the if `syntax` token resolves 2 known complexities with consistent groups:
1. Whether an immediately preceding break fired influences
2. The `spaceRemaining` value is only updated after printing the first `syntax` token on a new line
It's a little odd to group in this way, since it logically makes more sense to group around the entire if-stmt but there aren't any breaks between the if token and the first condition so moving the open token doesn't change the length of any breaks throughout the statement.
0 commit comments