Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363647 - [formatting] Insert spaces for tabs setting is not working within the Java text editor
Summary: [formatting] Insert spaces for tabs setting is not working within the Java te...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.8   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-12 13:31 EST by Sheila Miguez CLA
Modified: 2011-11-14 09:48 EST (History)
2 users (show)

See Also:


Attachments
installation details (780.09 KB, text/plain)
2011-11-12 13:34 EST, Sheila Miguez CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sheila Miguez CLA 2011-11-12 13:31:18 EST
Build Identifier: 20110916-0149

The spaces-for-tabs setting is not working within the Java text editor. Sometimes the editor inserts all tabs rather than spaces, sometimes it inserts spaces until it gets to the starting column of the block, followed by a tab. This happens differently depending on where the cursor is placed.

Reproducible: Always

Steps to Reproduce:
1. Start typing a new method in a java class. public void foo() {
2. Press return after the signature

Expected behavior:

Expect to see spaces all the way to where you'd expect the cursor to be.

Actual behavior:

Spaces appear until the starting column of the method, then a tab.
Comment 1 Sheila Miguez CLA 2011-11-12 13:34:24 EST
Created attachment 206894 [details]
installation details
Comment 2 Sheila Miguez CLA 2011-11-12 13:36:27 EST
I don't know if this happens in other perspectives. I opened a PyDev one and started editing a python file and didn't reproduce it when typing a new function; however, I don't typically use Eclipse when I edit python files, so I have not spent very much time working in this perspective. Perhaps if I had, I'd find cases where the insert setting was not honored.
Comment 3 Dani Megert CLA 2011-11-14 02:50:45 EST
The Java code formatting settings override this. Please check your formatter settings. If you still see the problem then please attach your formatter profile here and reopen the bug.
Comment 4 Sheila Miguez CLA 2011-11-14 09:48:25 EST
Thank you kindly!

I'm not sure why I wasn't seeing that behavior in earlier versions of eclipse. Maybe one of my plugins interacted with it to prevent that behavior. I use viPlugin, for example.