Bug 263834 - KDevelop must support pointer/reference align mode for indentation (reformatting)
Summary: KDevelop must support pointer/reference align mode for indentation (reformatt...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Unspecified
: HI normal
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 255039 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-21 10:36 UTC by Denis Pesotsky
Modified: 2011-04-02 15:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Pesotsky 2011-01-21 10:36:46 UTC
Version:           unspecified
OS:                unspecified

There are 3 ways to indent «*» in pointers and «&» in references:
int* a — Stroustrup style
int *a — K&R style
int * a — neutral guys style

astyle has «--align-pointer» option to handle this, it can be equal to type/middle/name.

KDevelop currently don't support this option in indentation/reformatting, but alligns to type on auto-completion (!) and that suxx. In most Qt and KDE sources, it's alligned to name. Personally I prefer alligning to name too.

Reproducible: Always

Steps to Reproduce:
Reformat following code:

Class& func(const QPoint &a)
{
    int *a;
    int * b;
    int* c;
    return *this;
}

Actual Results:  
Class& func(const QPoint &a)
{
    int *a;
    int * b;
    int* c;
    return *this;
}

Expected Results:  
It don't change pointers and references

Class &func(const QPoint &a)
{
    int *a;
    int *b;
    int *c;
    return *this;
}
Comment 1 Denis Pesotsky 2011-01-21 10:51:57 UTC
Dam I mistaken. Fixed:

Actual Results:  
It don't change pointers and references

Class& func(const QPoint &a)
{
    int *a;
    int * b;
    int* c;
    return *this;
}

Expected Results:  
Class &func(const QPoint &a)
{
    int *a;
    int *b;
    int *c;
    return *this;
}
Comment 2 Andrey 2011-01-21 11:25:28 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Milian Wolff 2011-01-24 13:57:59 UTC
yep, we need to update our astyle lib checkout and add the new features in there
Comment 4 Milian Wolff 2011-04-01 10:51:52 UTC
fixed since some time
Comment 5 Andrey Batyiev 2011-04-02 15:20:34 UTC
*** Bug 255039 has been marked as a duplicate of this bug. ***