Menu

#59 indent for line-broken statements

None
open
nobody
2019-02-27
2011-07-15
Anonymous
No

When there are no operators to align on, astyle 2.02 left-aligns the lines in multiple-line statements

long_name_of_pointer_to_class
->member_function();

I suggest an option --min-instatement-indent, analogous to --min-conditional-indent,
that applies when there would otherwise be no indentation relative to the first line of the statement.

Or, more simply, indenting the continuation lines by a fixed one indent level beyond the indent of their first line.

Somewhat related to 3255912, 3341867, 3116375, 3008369, 3344823

Discussion

  • Jim Pattee

    Jim Pattee - 2018-01-27

    Ticket moved from /p/astyle/bugs/103/

     
  • Bernard Schleich

    I have same idea and find this before posting mine :-)

    I will give an simple example:

    In my code, I format following C++ code like this

    XString sToday
        = pOciConnection
            ->SelectFetch("SELECT LOCALTIMESTAMP FROM DUAL")
                .GetString(1);
    

    if I use AStyle WHITESMITH, I obtain following lines

    XString sToday
        = pOciConnection
        ->SelectFetch("SELECT LOCALTIMESTAMP FROM DUAL")
        .GetString(1);
    

    I'm interesting to have first formatting because it is more readable (for me).

     

Log in to post a comment.

Monday.com Logo