Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Spaces Instead of Tabs In Eclipse Indigo PDT Not Working
Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #660649] Sun, 20 March 2011 12:43 Go to next message
PS Craig is currently offline PS Craig
Messages: 5
Registered: March 2011
Junior Member
OK - I've searched the forums and not found anything regarding this problem.

I am using Eclipse Indigo PDT (But I had the same problem before in Helios).

I have set all tabs to display as 4 spaces and it's not working, Eclipse is still entering tabs!

I have the following settings, am I missing something?:

General > Editors > Text Editors

  • Set Display tab width to 4
  • Tick Insert spaces for tabs
  • Tick Show Print Margin
  • Set Print Margin Column to 120


General > Workspace

  • Set Text File Encoding to UTF-8
  • Set New Text File Delimiter to Unix


PHP > Code Style > Formatter

  • Set Tab Policy to Spaces
  • Set Indentation size to 4


PHP > Editor > Save Actions

  • Tick Remove trailing whitespace
  • Check All Lines

Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #660654 is a reply to message #660649] Sun, 20 March 2011 13:02 Go to previous messageGo to next message
PS Craig is currently offline PS Craig
Messages: 5
Registered: March 2011
Junior Member
After a further search I've found an unanswered post, so it seems that I'm not the only one with this problem:

http://www.eclipse.org/forums/index.php?t=msg&th=94871
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #663283 is a reply to message #660649] Mon, 04 April 2011 10:30 Go to previous messageGo to next message
PS Craig is currently offline PS Craig
Messages: 5
Registered: March 2011
Junior Member
This is a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=326250
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #855290 is a reply to message #663283] Tue, 24 April 2012 13:25 Go to previous messageGo to next message
Bo Zimmerman is currently offline Bo Zimmerman
Messages: 3
Registered: April 2012
Junior Member
That is NOT the same bug as the user above is reporting (I'm having the same problem). The official bug is about tabs inside Strings. The problem I'm seeing is tabs inside Code.
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #993197 is a reply to message #660654] Sun, 23 December 2012 13:26 Go to previous messageGo to next message
Brian Detweiler is currently offline Brian Detweiler
Messages: 1
Registered: December 2012
Junior Member
You can count me as another person with this issue.

The problem seems to be on auto-indent. Pressing the tab key will insert spaces. But pressing enter after, say, an if-statement which auto-indents it will insert tabs. This is super annoying.
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #996986 is a reply to message #993197] Thu, 03 January 2013 05:47 Go to previous messageGo to next message
Marta Musik is currently offline Marta Musik
Messages: 1
Registered: January 2013
Junior Member
There are two settings affecting spaces vs tabs. One is where you mentioned:
"Window -> Preferences -> General -> Editors -> Text editors -> Insert spaces for tabs".
The other one is located in
"Java -> Code Style -> Formatter". In profile edition window "tab policy" can be chosen and also "use spaces to indent wrapped lines" can be checked. In my case that fixed the behavior you describes.
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #1059910 is a reply to message #660649] Wed, 22 May 2013 03:23 Go to previous messageGo to next message
Dani G is currently offline Dani G
Messages: 1
Registered: May 2013
Junior Member
As Marta points out, there is a similar setting for PHP in Preferences > PHP > Code Style > Formatter
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #1059983 is a reply to message #996986] Wed, 22 May 2013 08:49 Go to previous messageGo to next message
PS Craig is currently offline PS Craig
Messages: 5
Registered: March 2011
Junior Member
Marta Musik wrote on Thu, 03 January 2013 05:47
There are two settings affecting spaces vs tabs. One is where you mentioned:
"Window -> Preferences -> General -> Editors -> Text editors -> Insert spaces for tabs".
The other one is located in
"Java -> Code Style -> Formatter". In profile edition window "tab policy" can be chosen and also "use spaces to indent wrapped lines" can be checked. In my case that fixed the behavior you describes.


This did not fix the issue in the PDT version.
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #1103972 is a reply to message #660649] Sat, 07 September 2013 12:54 Go to previous message
Al Cramer is currently offline Al Cramer
Messages: 1
Registered: September 2013
Junior Member
If you're having trouble with tabs & spaces in Java code, you could try:

Project/Properties/Java Code Style/Formatter

Check "Enable Project Specific Settings", then select "Java Conventions [builtin]"
from the list.

(I write code in Vi and NEVER use \t's -- just multiple spaces. My code displayed very messily in the Juno Eclipse editor & debugger. But this fixed the problem).
Previous Topic:Error Log - Problem occurred when invoking org.eclipse.ui.navigator
Next Topic:customizing conext menu
Goto Forum:
  


Current Time: Wed Aug 27 15:15:44 EDT 2014

Powered by FUDForum. Page generated in 0.01747 seconds