Seemingly impossible to convince atom to insert only spaces


#1

Hi, I’ve search this here discuss section and tried many different configuration options but I cannot for the life of me figure out how to get only spaces inserted. Even when I manually insert 4 spaces they are automatically replaced with tabs.

I have seen other posts where the opposite happens and tabs are replaced with spaces but not this way around.

I’ve also tried a couple of packages ‘Tabs to Spaces’ and ‘Whitespace’ but neither seem to be able to help.

I don’t want to get into the merits of tabs vs. spaces but it would be nice to know how to get this to function correctly.

Thanks
Chris


#2

In order to get spaces inserted:

  1. Set the editor.softTabs setting to true
  2. In the file you’re trying to edit, use either Whitespace: Convert Tabs To Spaces or Tabs To Spaces: Untabify (you can also use the Untabify on Save feature of my Tabs to Spaces package)
  3. Close the file and open it again to get Atom to re-detect what it should use

You can also use my indentation-indicator package to have Atom display what setting it is using for the current file.

The reason why you need to go through this is because Atom has an autodetect algorithm for determining what setting it should use, whether or not softTabs is on or off. And it does have strange edge cases.

What you can do to help this situation is give us exact steps to reproduce the behavior that you consider to be a bug. Including:

  • Which version of Atom are you using?
  • What OS and version are you running?
  • Can you reproduce the issue after completely exiting Atom and restarting using atom --safe?

#3

Thanks. You know what, this seems to be a problem between my keyboard and chair. While it appears that tabs are being inserted on closer inspection they are not. You indentation indicator seems to be correct but from my perspective in atom it looks as if they are tabs because of the way the caret moves.

So, deepest apologies. On a similar vein, Is there away I can turn off this behaviour? When I shift one space I want to move one space. If not then I guess I will have to get used to it, I understand the reason for it I suppose.

Thanks again.


#4

There is not currently a way to turn off this behavior. There is an Issue open on it on the Atom repository: