Disable auto-indentation of C++ files


Hi all,

I came across an issue that in some specific cases Atom indents C++ files I am editing although I think I turned any and all auto-formatting.

One example is that the space after if is removed and the next line is indented with 4 spaces instead of 2:

    values[local_index] = 1.;

Settings->Editor->Auto Indent / Auto Indent on Paste are turned off.
I have language-c and language-cpp+14, but the same setting is also turned off there.

I would appreciate any help to figure out why the file gets indented.

p.s. the file is auto-detected ad C++14.



The language-cpp14 package’s default settings have tabLength set to 4, so I find it strange that you’re seeing two-space tabs elsewhere.


I am not sure this is related. I don’t use tabs at all, the problem is that I have

if (...)

that is, there is space after if and two spaces before blabla, and this gets indented to what I showed in the OP.


Does this happen if you open Atom from the command line with atom --safe?

Whether you use tabs or spaces doesn’t matter. Indentation levels function nearly identically. tabLength is the number of character columns used by an indentation level.

and this gets indented to what I showed in the OP.

And what action do you perform that results in the indentation occurring?