0

I would like to get the following cc-mode indentation behavior (c-basic-offset is 4):

outerFunction(innerFunction(
    parameter1, parameter2));

However I would like to maintain arglist aligned indentation for parameters after the first:

outerFunction(innerFunction(parameter1,
                            parameter2));

By default the second one is indenting correctly, but the first is indenting as follows (one c-basic-offset from innerFunction rather than outerFunction):

outerFunction(innerFunction(
                  parameter1, parameter2));

The issue is that both parameter1 in the first example and parameter2 in the second are recognized as arglist-cont-nonempty by M-x c-show-syntactic-information. So I cannot define separate indentation levels for them.

The default indentation for arglist-cont-nonempty is 'c-lineup-arglist, which is needed to preserve the behavior in the second example. Is there a way to customize the indentation that is used by 'c-lineup-arglist when the line starts with the first parameter (i.e. open-paren precedes it)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.