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

Bug 361961

Summary: [formatting] Source shift-left and shift-right add tabs instead of spaces
Product: [Eclipse Project] JDT Reporter: pawan
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: markus.kell.r, pawan
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description pawan CLA 2011-10-25 12:53:49 EDT
Build Identifier: 20100917-0705

Even though I have set my preference for the Java, C/C++ editor to use spaces instead of tabs, whenever I use "shift left" or shift right, tabs are inserted instead of spaces. Tabs are also inserted randomly in other editing operations. This is very annoying and am surprised to find this in Helios - one would have thought this bug would have been found and quashed in the first or second version of eclipse.

Reproducible: Always

Steps to Reproduce:
1. Select a few lines of C or Java code
2. Use soruce->shift right
3. Tabs will be inserted instead of spaces
even though the preference is set to use spaces.
Comment 1 Markus Keller CLA 2011-10-25 13:36:20 EDT
In the Java editor, the code formatter preferences for the current project or workspace determine all aspects of code formatting. If you configure it to use spaces, then the Source actions also use spaces.

You probably enabled "Insert spaces for tabs" on the "Text Editors" preference page. But that option is not applicable here.