Retain blank lines? #1019
-
Blank lines are often used to separate logically related statements in a block, something like: # Foo the bars
foo(bar1)
foo(bar2)
foo(bar3)
# Bar the foos
bar(foo1)
bar(foo2)
bar(foo3)
cleanup() with formatters usually squashing adjacent blank lines into one. Is there some way to do this currently? Or could this feature be added? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Using Topiary to insert blank lines was recently discussed in #993. The current workaround is to use In the example you give, it looks like the blank lines are based on semantics, rather than syntax. In this case, Topiary would need to take its direction from the input (i.e., the author's intention) and the The vertical spacing chapter in the Topiary Book gives more detail. |
Beta Was this translation helpful? Give feedback.
Using Topiary to insert blank lines was recently discussed in #993. The current workaround is to use
@{append,prepend}_delimiter
with\n\n
as the delimiter. However, the discussion suggested that having dedicated@{append,prepend}_blankline
capture names would be beneficial, so it's something we'll look into.In the example you give, it looks like the blank lines are based on semantics, rather than syntax. In this case, Topiary would need to take its direction from the input (i.e., the author's intention) and the
@allow_blank_line_before
capture would be used in the formatting queries to preserve those blank lines.The vertical spacing chapter in the Topiary Book gives more detail.