Bug 89140

Summary: Code formatting parameter list alignment with leading commas fails
Product: [Applications] kdevelop Reporter: Steven T. Hatton <hattons>
Component: AstyleAssignee: kdevelop-bugs-null
Status: RESOLVED NOT A BUG    
Severity: normal CC: hceylan
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Steven T. Hatton 2004-09-09 10:30:59 UTC
Version:           3.1.0 (using KDE 3.3.0, SuSE)
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.5-7.108-default

I have been rediscovering the convenience of using leading commas
in parameter lists, and member initialization lists.  When the indentation works correctly, I find it much easier to work with. Unfortunately, I've noticed a problem that arrises when default values are assigned to the formal parameters.  The indentation aligns at the location of the RHS token, not the previous comma. The snippet included here shows the problem.
LinearBoxView(Box_Interface* bif
                    , const size_t& offset_
                    , LinearView* holder_
                    , const size_t& block_w_ = 10
                                               , const size_t& block_h_ = 10
                                                                          ,  const size_t& edge_w_=1
                   );
Comment 1 Jens Dagerbo 2004-09-09 21:04:49 UTC
Are you talking about the automatic indentation (katepart) or "Edit -> Reformat Source" (KDevelop)?
Comment 2 Steven T. Hatton 2004-09-12 03:32:33 UTC
On Thursday 09 September 2004 15:04, Jens Dagerbo wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=89140
>
>
>
>
> ------- Additional Comments From jens.dagerbo swipnet se  2004-09-09 21:04
> ------- Are you talking about the automatic indentation (katepart) or "Edit
> -> Reformat Source" (KDevelop)?

Settings->Configure Shortcut->Reformat Source 
Comment 3 Jens Dagerbo 2004-09-12 05:40:57 UTC
"Configure shortcut"? I don't get it.. but I assume you mean you are using the KDevelop reformatting tool (which is based on the astyle library, btw)

(Btw, please don't quote stuff in bug reports, it bloats the webpage )
Comment 4 Steven T. Hatton 2004-09-12 09:05:48 UTC
I meant that is how I set it up.  I didn't know what it actually invokes. I 
just know I mapped it to Tab and my code gets reformatted when I hit Tab.
Comment 5 Matt Rogers 2006-10-15 07:00:16 UTC
*** Bug 92342 has been marked as a duplicate of this bug. ***
Comment 6 Matt Rogers 2006-10-15 07:01:40 UTC
The use of the equals sign in the parameter list is confusing astyle.
Comment 7 Jens Dagerbo 2006-12-16 19:39:02 UTC
Yup. Still happening with 3.4-RC2.
Comment 8 Andreas Pakulat 2007-11-30 20:27:42 UTC
Closing as this is an obviously astyle problem, please file upstream (astyle.sourceforge.net).