Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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 13:10 Go to previous message
Eclipse UserFriend
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 27 23:53:21 EDT 2025

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

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

Back to the top