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
For example, here I've deliberately added two spaces before "m" and "o" elements, but they are not converted to a single space by {styler}, which is what I would expect. Does that make sense?
The text was updated successfully, but these errors were encountered:
IndrajeetPatil
changed the title
Have only a single space character between vector and list elements?
Have only a single space character between elements and their separators?
Jan 14, 2022
Thanks @IndrajeetPatil for your perseverance regarding alignment 😄. The reason for the behavior is that the current implementation requires all columns to be aligned for taking code as aligned, and that is the case in your example. Column 1 and 2 are aligned, and for the remainder of the columns, there is always just one instance, and an instance is always aligned with itself. For example for column 3, there is one line in the set we check, and all elements in this set (just one) match by comma. We need to adapt the rules that
For code to be aligned, columns that have only one row must have only one space after the most right comma from the previous column.
Like in the below example, the first column that has one row is column 2. So the previous column is column 1, and for this column, row 3 has the most right comma, so from that position, we add one space and then, column 2 must start.
c(
"x", "z",
"cgjhg",
) ^mostrightcomma
This should also work when things are right-aligned:
Uh oh!
There was an error while loading. Please reload this page.
For example, here I've deliberately added two spaces before
"m"
and"o"
elements, but they are not converted to a single space by{styler}
, which is what I would expect. Does that make sense?observed
Created on 2022-01-14 by the reprex package (v2.0.1.9000)
expected
The text was updated successfully, but these errors were encountered: