Atom messing up indentations in existing c++ file


#1

Hello,

When I open a file, previously edited with emacs, which displays all indentations as expected in emacs I find in atom that the indents are apparently ignored so that I have formatting like:

for (x = 0; x > 5; x++){
// do something
}

I would expect " //do something" do be indented to right of the {}, and that is what happens with emacs. I am not sure why but here I cannot show the exact formatting - in fact in atom the “do something” is displayed to the left of the {} (and not in line with it as here).

I wonder if atom is interpreting the indent differently, and if so why that would be? Is there a way to solve this?

I am using emacs and atom on OS X, reading files from a linux system via MACFuse.

Thanks,

Mark


#2

So indentation (as well as syntax highlighting) is done by the specific language packages.
Can you confirm which language is shown in the lower right corner of Atom, after you opened this file?


#3

It says “UTF-8 C++”. To the left of that it has an orange warning symbol and says “1 deprecation”.


#4

So this will be handled by the language-c package.

If this still happens after opening Atom in safe mode (atom --safe), then it’s worthwhile to have a look through the open issues on that package’s repository, and if your problem hasn’t been reported yet, open a new one.


#5

Hello,

ok thanks! I get the same result when using the --safe option.

Unfortunately in your link I find many reports of this, but no mention of someone planning to fix it. There do appear to be some leads on external package add-ons that solve this, so I can try those perhaps.

Cheers,

Mark