Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indent with tabs do not work
Indent with tabs do not work [message #1019453] Fri, 15 March 2013 14:15 Go to next message
censored censored is currently offline censored censored
Messages: 5
Registered: March 2013
Junior Member
I have set code formatter "Tab policy" option to "Tabs", but editor always use spaces in indentation instead of tabs.
Re: Indent with tabs do not work [message #1020958 is a reply to message #1019453] Tue, 19 March 2013 04:53 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Preferences->General->Editors->Text Editors
Do you have "Insert spaces for tabs" enabled? This might interfere with the code formatter.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Indent with tabs do not work [message #1023097 is a reply to message #1020958] Sat, 23 March 2013 04:27 Go to previous messageGo to next message
censored censored is currently offline censored censored
Messages: 5
Registered: March 2013
Junior Member
No, I have not "Insert spaces for tabs" enabled. It seems that formatter considers the tab size equal to 8 spaces. And when I make first indent (I have 4 spaces for indent size), it inserts 4 spaces. Then I make second indent and it replaces first 4 spaces by two tabulations.

[Updated on: Sat, 23 March 2013 04:47]

Report message to a moderator

Re: Indent with tabs do not work [message #1023102 is a reply to message #1023097] Sat, 23 March 2013 04:46 Go to previous messageGo to next message
censored censored is currently offline censored censored
Messages: 5
Registered: March 2013
Junior Member
Take a look at this video: [https]://dl.dropbox.com/u/33529975/indent.ogv. I think it will explain my problem.
Re: Indent with tabs do not work [message #1023812 is a reply to message #1023102] Mon, 25 March 2013 04:10 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
In your video you have set code formatter "Tab policy" option to "Mixed". In your first comment you said that you use the option "Tab". What is correct? Do you have problems with both options?
In Preferences->C/C++->Editor->Typing you should see the current identation size and method. Check this.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Indent with tabs do not work [message #1024078 is a reply to message #1023812] Mon, 25 March 2013 15:42 Go to previous message
censored censored is currently offline censored censored
Messages: 5
Registered: March 2013
Junior Member
It's very strange but "Tab policy" is completely ignored for first indent level. I set this option to "Tabs" and still got four spaces instead of the tabulation. Only after auto-formatting all source file with Ctrl+I indenter start work properly.
Previous Topic:CDT - How do i have to configure my Eclispe to use Linux Gcc
Next Topic:Auto complete not working for opengl?
Goto Forum:
  


Current Time: Wed Aug 27 09:09:12 EDT 2014

Powered by FUDForum. Page generated in 0.01721 seconds