| Summary: | formatter.indent_access_specifier_extra_spaces!=0 breaks indenter | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Achim Bursian <abu.aud> | ||||
| Component: | cdt-editor | Assignee: | Project Inbox <cdt-editor-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | Anton Leherbauer <aleherb+eclipse> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, eclipse.sprigogin, yevshif, zeratul976 | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 199553 [details]
Exported style settings
Do you still experience this problem? I imported the attached file and indented the code example you provided, and could not trigger the problem. |
Build Identifier: I20110613-1736 In our legacy code, an indentation of 4 spaces is used, but only 2 spaces for the access specifiers (public:, protected:...) That was not supported in the CDT formatter up to now, but I was happy to find the new setting formatter.indent_access_specifier_extra_spaces in Indigo, which provides exactly what I need. I set org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces to 2, and org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header to false. These settings work fine with the CDT formatter, but if you select a code area that includes one of the access specifiers and use the indenter (Ctrl-I), the code gets indented wrongly: Using this as base: class OutDp: public OutDriver { public: OutDp(); ~OutDp(); void reInit(int axisNr, int outputNr); void checkInit(int axisNr); }; after indenting: class OutDp: public OutDriver { public: OutDp(); ~OutDp(); void reInit(int axisNr, int outputNr); void checkInit(int axisNr); }; Every line adds 2 more spaces. If the line with the "public:" specifier is not included in the selected area, the indenter works fine! Reproducible: Always Steps to Reproduce: 1. copy test code (see above) into a *.h file 2. select the whole class 3. press Ctrl-I