Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350048

Summary: CDT editor not respecting "Insert spaces for tabs" preference
Product: [Tools] CDT Reporter: Jonathan Watt <jwatt>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: CLOSED DUPLICATE QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Jonathan Watt CLA 2011-06-22 09:04:35 EDT
Under Preferences > General > Editors > Text Editors, I have "Insert spaces for tabs" checked. In any .cpp file I'm editing using Eclipse the auto-complete functionality doesn't seem to honor that setting though. If I type "void func() {" in the global scope of the .cpp file and hit Enter, Eclipse will insert a line break, a tab, a line break and a closing "}". Instead of the tab, it should be inserting spaces.
Comment 1 Jonathan Watt CLA 2011-06-22 09:05:39 EDT
Oh, and another thing it's not honoring is the "Displayed tab width" from that same preference pane. I have it set to 2, but the tabs that it's inserting are indenting by 4.
Comment 2 Anton Leherbauer CLA 2011-06-22 09:13:37 EDT
CDT overrides the text editor settings in favor of more advanced code style settings.  You'll find the overriding settings in the C/C++ > Code Style preference page.

*** This bug has been marked as a duplicate of bug 206776 ***
Comment 3 Jonathan Watt CLA 2011-06-22 09:45:39 EDT
Ah, I see. Thanks Anton.