3

Currently in C mode, contents of a muli-line arrays are aligned with the brace. eg:

const unsigned int array[4] = {
                               A,
                               B,
                               C,
};

Is there a way to configure cc-mode to use a single indentation in this case?

const unsigned int array[4] = {
    A,
    B,
    C,
};

e.g. if indentation is set to 4 spaces.

1
  • 1
    This also affects enum definitions..
    – kalj
    Sep 10, 2020 at 7:28

1 Answer 1

2

The following setting makes brace lists use a single indent:

(c-set-offset 'brace-list-intro '+)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.