Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361961 - [formatting] Source shift-left and shift-right add tabs instead of spaces
Summary: [formatting] Source shift-left and shift-right add tabs instead of spaces
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.8   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 12:53 EDT by pawan CLA
Modified: 2011-10-25 13:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.