-
Notifications
You must be signed in to change notification settings - Fork 25
Feature request: inline functions with if statements #76
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Consider this case:
#table(
fill: (x, y) => if y == 0 { white.darken(15%) } else { none },
align: (x, y) => if y == 0 { center } else { horizon },
[Hi],
[there],
)The function definition is short (< line length) and clearly indicates parameter usage. typstyle reformats to:
#table(
fill: (x, y) => if y == 0 {
white.darken(15%)
} else {
none
},
align: (x, y) => if y == 0 {
center
} else {
horizon
},
[Hi],
[there],
)which is arguably less readable.
My request is for inline ternary functions shorter than the user-specified line length to remain one-line.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers