Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch case ranges on same line #561

Open
rikkimax opened this issue Jul 14, 2022 · 1 comment
Open

Switch case ranges on same line #561

rikkimax opened this issue Jul 14, 2022 · 1 comment

Comments

@rikkimax
Copy link
Contributor

Example:

    bool isALetter(dchar input) {
        switch (input) {
        case 0x02C2: .. case 0x02C5:
        case 0x02D2: .. case 0x02D7:
        case 0x02DE:
        case 0x02DF:
        case 0x02E5: ..
        case 0x02EB:
        case 0x02ED:
        case 0x02EF: .. case 0x02FF:
        case 0x055A:
        case 0x055B:
        case 0x055C:
        case 0x055E:
        case 0x058A:
        case 0x05F3:
        case 0xA708: ..
        case 0xA716:
        case 0xA720:
        case 0xA721:
        case 0xA789:
        case 0xA78A:
        case 0xAB5B:
            return true;

        default:
            return true;
        }
    }

The case 0x02EB should be kept on the same line as 0x02E5.

@rikkimax
Copy link
Contributor Author

With dfmt_align_switch_statements set to false:

    bool isALetter(dchar input) {
        switch (input) {
            case 0x02C2: .. case 0x02C5:
            case 0x02D2: .. case 0x02D7:
            case 0x02DE:
            case 0x02DF:
            case 0x02E5: ..
                case 0x02EB:
                case 0x02ED:
                case 0x02EF: .. case 0x02FF:
                case 0x055A:
                case 0x055B:
                case 0x055C:
                case 0x055E:
                case 0x058A:
                case 0x05F3:
                case 0xA708: ..
                case 0xA716:
                case 0xA720:
                case 0xA721:
                case 0xA789:
                case 0xA78A:
                case 0xAB5B:
                    return true;

                default:
                    return true;
                    }
        }

@rikkimax rikkimax mentioned this issue Jul 14, 2022
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant