Author Topic: Tabs are inserting spaces, not tabs in C\C++  (Read 668 times)


  • Senior Community Member
  • Posts: 477
  • Hero Points: 16
Tabs are inserting spaces, not tabs in C\C++
« on: July 20, 2021, 05:35:29 pm »
SE v25.0.1.0
I have a project created with "Other C\C++". The code has a mix of programming styles (K&R, Allman) which I am fine with. No issues with that. I always disabled the adaptive formatting anyway as I could never quite figure out how to get the switch statement to format the way I want.

I enter "Indent" into the Options search. Under C\C++ Editing, there are a few settings. I have tried various incarnations of setting but can get it to work. SE always tabs with spaces.
Tab key reindents line: Currently it is set to Never
Tab key: Currently set to Use tab stops
Indent style: Current set to None
-- The help file mentions None, Auto. However, there is another selection that is not in the Help file, Syntax Indent.
Insert real Indent: Unchecked.
-- Even after reading the help file, I am not sure what this is for. But, I'm pretty sure I don't need it.

All I really want is to press the Tab key and insert a Tab. I recall a setting some revisions ago, something like "Always Indent with Tabs". I don't see that, unless I missed it.

Also, can you clarify, the term "syntax indent" in these options means to indent according to the language and style (Allman, etc).

I noticed that Beautify syntax expansions and Beautify alias expansions are checked. Maybe that affects it?


  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1783
  • Hero Points: 150
Re: Tabs are inserting spaces, not tabs in C\C++
« Reply #1 on: July 20, 2021, 09:00:59 pm »
In the options dilalog, under Languages -> Application Languages -> C/C++ go to Formatting, hit Edit, and then go to Indent -> General, and uncheck the "Indent with tabs setting."  It can also be set for a All Languages via the Languages -> All Languages section, or the Quick Start dialog under Tools -> Quick Start Configuration...

Syntax Indent is the indent that's use for statement indenting.  For C/C++ it's most commonly the indent used for statements inside of a brace block.