Enter-tainer / typstyle

Beautiful and reliable typst code formatter
https://enter-tainer.github.io/typstyle
Apache License 2.0
341 stars 11 forks source link

Strange formatting of long show-set rule #143

Open Andrew15-5 opened 1 month ago

Andrew15-5 commented 1 month ago
#show heading.where(level: 2): set heading(numbering: (..n) => [#n.pos().at(1).])

with typstyle -c 80:

#show heading.where(level: 2): set heading(numbering: (
  ..n,
) => [#n.pos().at(1).])

I think it's much more readable to prefer first breaking by 1 parameter per line:

#show heading.where(level: 2): set heading(
  numbering: (..n) => [#n.pos().at(1).],
)
Enter-tainer commented 1 month ago

I'm not entirely sure what's happending but it looks like this falls into a special handling for single parameter function call. I will look into it later.