atom-auto-indent icon indicating copy to clipboard operation
atom-auto-indent copied to clipboard

Not working properly for C++ or C language

Open terrylai opened this issue 9 years ago • 1 comments

Hello,

I found it is not working properly for C or C++ language.

For example,

if (fTestNet && fRegTest)
    return false;

After auto indentation, it will become:

if (fTestNet && fRegTest)
return false;

Another example is:

void SelectParams(CChainParams::Network network) {
    switch (network) {
        case CChainParams::MAIN:
            pCurrentParams = &mainParams;
            break;
        case CChainParams::TESTNET:
            pCurrentParams = &testNetParams;
            break;
        case CChainParams::REGTEST:
            pCurrentParams = &regTestParams;
            break;
        default:
            assert(false && "Unimplemented network");
            return;
    }
}

After auto indentation it will become:

void SelectParams(CChainParams::Network network) {
    switch (network) {
        case CChainParams::MAIN:
        pCurrentParams = &mainParams;
        break;
        case CChainParams::TESTNET:
        pCurrentParams = &testNetParams;
        break;
        case CChainParams::REGTEST:
        pCurrentParams = &regTestParams;
        break;
        default:
        assert(false && "Unimplemented network");
        return;
    }
}

BR, Terry

terrylai avatar Nov 24 '15 02:11 terrylai

Hey,

Sadly, that's how Atom indents. I have find how to deal with these issues.

Any solution would be great ;-;

Regards, LeNiglo.

LeNiglo avatar Dec 02 '16 10:12 LeNiglo