|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Fri Sep 24, 2010 12:59 am
[3.29a] Switch else statement reformatting |
I thought I'd try the reformatting on various switch statements I have since they've historically been problematic with the reformatting, and you were recently working on it. However, feel free to delay work on something like this until you have more time.
Reformat this:
Code: |
#switch (%null( %1)) {pa plant|ink|commodity}
(%1 == all) {pa plant|ink|commodity|crystal}
{#forall %1 {#if (1) {#say Syntax}}} |
Gives this:
Code: |
#switch (%null( %1)) {pa plant|ink|commodity}
(%1 == all) {pa plant|ink|commodity|crystal}
{
#forall %1 {
#if (1) {#say Syntax}
}
} |
While it would appear much better something like this:
Code: |
#switch (%null( %1)) {pa plant|ink|commodity}
(%1 == all) {pa plant|ink|commodity|crystal}
{
#forall %1 {
#if (1) {#say Syntax}
}
} |
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Sep 24, 2010 2:07 am |
It's because CMUD is expecting you to only indent each level by 2 spaces each. This isn't going to get fixed, sorry.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Fri Sep 24, 2010 4:27 am |
I like to make my parenthetical clauses line up as well.. so I feel your pain.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Sep 24, 2010 4:08 pm |
The "official" syntax for this is:
Code: |
#switch
(%null( %1)) {pa plant|ink|commodity}
(%1 == all) {pa plant|ink|commodity|crystal}
{
#forall %1 {
#if (1) {#say Syntax}
}
} |
which has the () all lined up but uses the proper two-space indent value. At least that is what my goal for Reformat would be if I was able to fix this. |
|
|
|
|
|