Bug 472686 - mars c++ editor tab policy not being set when changed
Summary: mars c++ editor tab policy not being set when changed
Status: REOPENED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-15 02:06 EDT by ray shpeley CLA
Modified: 2020-09-04 15:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ray shpeley CLA 2015-07-15 02:06:30 EDT
Under Window:Preferences:General:Editors:Text Editors I set "Displayed tab width:" to 2 and checked the box "Insert spaces for tabs". The c++ editor does not respect the new setting and remains with a default tab of 4 (with no spaces), however the text editor (right click on file and open with Text Editor) does respect the setting.

Under Window:Preferences:C/C++:Editor it states that C/C++ preferences are set via Text Editors with a link back to the setting above where it shows my changes. 

If I remember correctly this is a change from Luna where the tab policy was set for each editor. I haven't checked if the problem occurs with other editors.

Needless to say it makes the editor difficult to use when your coding standard is for 2 space tabs.
Comment 1 Anton Leherbauer CLA 2015-07-15 02:35:48 EDT

*** This bug has been marked as a duplicate of bug 290994 ***
Comment 2 ray shpeley CLA 2015-07-15 03:19:07 EDT
Anton stated in bug 290994:
Since 4.0 the C/C++ Editor has advanced code style preferences which override tab settings from the general Text Editors page, just like the Java Editor. 
The tab width for the C/C++ Editor can be set on the C/C++ > Code Style preference page.
------
In Mars I see no setting in C/C++ Code Style for tab width or for setting the tab as spaces. Perhaps you can take the effort to point out to me and others who see this bug how this setting is changed. I want a tab width of 2 space characters, not 1 tab character.

As I pointed out the setting for the C/C++ editor specifically states that general settings in the Text Editor are respected by the C/C++ editor. This statement is wrong since it doesn't align with the operation of the editors. If Code Style does change the tab as you suggest then this statement should be corrected and the link back the the text editor settings removed.

Incidently, I did review bug 290994 prior to posting a new instance and I still think it's not relevant to the problem. This looks like a case where the general preferences of the textual editors have been centralised in Mars but yet not actualised in practice.
Comment 3 Anton Leherbauer CLA 2015-07-15 04:12:59 EDT
(In reply to ray shpeley from comment #2)
> Anton stated in bug 290994:
> Since 4.0 the C/C++ Editor has advanced code style preferences which
> override tab settings from the general Text Editors page, just like the Java
> Editor. 
> The tab width for the C/C++ Editor can be set on the C/C++ > Code Style
> preference page.
> ------
> In Mars I see no setting in C/C++ Code Style for tab width or for setting
> the tab as spaces. Perhaps you can take the effort to point out to me and
> others who see this bug how this setting is changed. I want a tab width of 2
> space characters, not 1 tab character.

The Code Style page was renamed/moved to Code Style > Formatter some time ago.
Therefore above statement should read now:
The tab width for the C/C++ Editor can be set on the C/C++ > Code Style > Formatter preference page.

Sorry if this has caused confusion.
Maybe we should add a note in the C/C++ > Editor page with a link to the Formatter page. I also noticed that we miss tab and space keywords for the Formatter page.