Skip to content

Requesting update to C/C++ indentation rules for more common switch statement formatting #68

@theosib

Description

@theosib

TextMate auto-indents C and C++ in an unexpected way. To be specific, I would like to get:

This (1):

switch (x) {
    case 3:
        sdrhit;
    case 4:
        dfsdkfsd;
}

Or this (2):

switch (x) {
case 3:
    sdrhit;
case 4:
    dfsdkfsd;
}

Unfortunately, instead, I get this:

switch (x) {
    case 3:
    sdrhit;
    case 4:
    dfsdkfsd;
}

I looked into this, and I understand that the Swift indent rules would behave as I expect. I'm told that I can edit the indentation rules, but for C, I don't see the word "select" mentioned anywhere in the indentation rules, so this is confusing to me. My opinion is that (1) or (2) should be default, but at the very least, documentation somewhere about how to change them to fix this specific case would be really nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions