Skip to main content


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 16:43 Go to next message
PS Craig is currently offline PS CraigFriend
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 17:02 Go to previous messageGo to next message
PS Craig is currently offline PS CraigFriend
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 14:30 Go to previous messageGo to next message
PS Craig is currently offline PS CraigFriend
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 17:25 Go to previous messageGo to next message
Bo Zimmerman is currently offline Bo ZimmermanFriend
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 18:26 Go to previous messageGo to next message
Brian Detweiler is currently offline Brian DetweilerFriend
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 10:47 Go to previous messageGo to next message
Marta Musik is currently offline Marta MusikFriend
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 07:23 Go to previous messageGo to next message
Dani G is currently offline Dani GFriend
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 12:49 Go to previous messageGo to next message
PS Craig is currently offline PS CraigFriend
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 16:54 Go to previous messageGo to next message
Al Cramer is currently offline Al CramerFriend
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).
Re: Spaces Instead of Tabs In Eclipse Indigo PDT Not Working [message #1738731 is a reply to message #660649] Fri, 22 July 2016 17:10 Go to previous message
Tim Ahrens is currently offline Tim AhrensFriend
Messages: 1
Registered: July 2016
Junior Member
In Eclipse for JavaScript and Web Developers, Version: Neon Release (4.6.0)
The settings were found under:
Web > CSS Files > Editor > Check - Indent using spaces
and
Web > HTML Files > Editor > Check - Indent using spaces
Previous Topic:Error occurred during: "Initializing plug-in models"
Next Topic:Behavior of the Multiple Tabs preference
Goto Forum:
  


Current Time: Thu Mar 28 21:44:51 GMT 2024

Powered by FUDForum. Page generated in 0.02333 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top