You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
"Soft tabs" don't work (tab and enter keys add tabs instead of spaces) #5497
Oh yes, toggling "Editor: Toggle Soft Tabs" from the command palette works great. So what about the preferences: maybe it is just a default for newly-opened editor tabs? If so, I believe that this should be documented below the checkbox in preferences.
Any chance the file has a tab as the first character of the first non-comment line? Or any chance you already triggered the "Editor: Toggle Soft Tabs" command previously? Can you share a link to the file in question or share it in a gist?
See #5192 for a similar issue (this should be fixed when #3719 is fixed).
I think it might be related to js-formatter plugin which converted all my spaces to tabs, and only after configuring it I got the spaces back there. So at the time when I was opening the file it had tabs.
I would love to have some status bar icon showing the current status of this flag (tabs or spaces). Something like a warning icon that says "hey, you have chosen to use spaces in the preferences, but this file uses tabs, so Atom will indent your lines with tabs". The current behaviour is far from intuitive.
same for me, makes writing python a nightmare
the checkbox in preferences is extremely misleading, sort of got it right by changing config
still, leading spaces are automatically grouped by 4, making it impossible to change my indent level to 2. this is weird behaviour to be sure
This is a misfeature!
Soft tabs should never be the default behavior. At the very least tell us in the status line what's going on. Even if it's trying to auto-detect, this is too much magic. People rely on correct whitespace like they rely on correct encoding.
Changing user input like this is bad especially if it doesn't even announce itself.
I just learned about this while a heredoc was breaking and now I wonder how many files I may have contaminated.
Absolutely ridiculous!
This is my first time using Atom. When I tried to use emmet I faced the same problem that every one here, so, after trying with different options, at the end I found that using the keys combination ctrl+shift+enter is more confortable than traditional way, y recomended it, you will be seeing in real time how html will be rendered
The big issue as reported is the inaccurate "guessing" combined with the inability for an editor-wide setting (and not per-file setting). It may be that several preferences may be required instead of having one monolithic setting which is clearly causing unhappiness:
Default for all files (y/n)
Default for certain files (by file extension)
Setting on per file basis
The idea would be to be able to re-order these in terms of priority, based on the needs of the user.
Reacted by refactorsaurusrex, Stephen Tetreault and Rob Fowler
Please keep this open, its been a while since June and this is still a problem and I agree its about to make me switch away from atom its that annoying...
Thought I was alone with this issue, but then I found this issue.
It isn't just the editor itself, seems to be some underlying code that causes it because not even the package tabs-to-spaces can convert tabs in a html-file to pure spaces.
I sure wish there was a never-ever-ever-ever use tabs ever in any file ever regarding of package settings thing to turn ON and then delete the code that shows the button.
I have been struggling with this for a long time. I cannot get atom to do a soft tab with 2 spaces. It never, never, never does it. Incredibly frustrating to go through and set it in the editor and then follow this message chain and not find an answer that actually works. Otherwise, Atom is very nice if a bit slow at times. I guess its time to go back to sublime text.
Reacted by refactorsaurusrex, Rahil Wazir, Tarrence van As and Colby Gutierrez-Kraybill
Reacted by Kristian Wedmark and Colby Gutierrez-Kraybill
I was having this exact problem. Cursor would jump over like it was a hard tab, even find and replace using an actual tab would detect tabs all over the file. Then I found Atomic Soft Tabs option under Editor settings. It was ticked. I unticked it and now my problem seems to be solved. Very frustrating though.
Reacted by Brien Elwood Washburn, ttparker, Hexonium and Colby Gutierrez-Kraybill
+1 for skizot722 a couple comments up. Make certain that the option "Atomic Soft Tabs" is unchecked in Editor. I realized something was wrong when I ran the command (using Vim)
:%s/\t/1/g
and nothing was replaced. I ran
:%s/ /1/g
and all the supposed tabs turned into 4 1's (I have tabwidth set to 4). Now when I hit delete on macOS it will actually go a space at a time.
@timsully this command is supposed to be used in Vim mode (vim-mode-plus plugin). It has the same effect as hitting Ctrl-Shift-F and replacing space with \t in regexp mode.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Activity
izuzak commentedon Feb 11, 2015
Can you try running the "Editor: Toggle Soft Tabs" command from the command palette while that file is open, and see if that helps?
mik01aj commentedon Feb 11, 2015
Oh yes, toggling "Editor: Toggle Soft Tabs" from the command palette works great. So what about the preferences: maybe it is just a default for newly-opened editor tabs? If so, I believe that this should be documented below the checkbox in preferences.
izuzak commentedon Feb 11, 2015
No, there's some auto-detection:
https://github.com/atom/atom/blob/master/src/text-editor.coffee#L2350-L2369
Any chance the file has a tab as the first character of the first non-comment line? Or any chance you already triggered the "Editor: Toggle Soft Tabs" command previously? Can you share a link to the file in question or share it in a gist?
See #5192 for a similar issue (this should be fixed when #3719 is fixed).
mik01aj commentedon Feb 11, 2015
I think it might be related to js-formatter plugin which converted all my spaces to tabs, and only after configuring it I got the spaces back there. So at the time when I was opening the file it had tabs.
I would love to have some status bar icon showing the current status of this flag (tabs or spaces). Something like a warning icon that says "hey, you have chosen to use spaces in the preferences, but this file uses tabs, so Atom will indent your lines with tabs". The current behaviour is far from intuitive.
izuzak commentedon Feb 11, 2015
Please feel free to open an issue in the status bar package: https://github.com/atom/status-bar
mark-hahn commentedon Feb 11, 2015
I think @LEEDOHM has a package for this. He has two or three packages to
help with the tab/space problems.
On Wed, Feb 11, 2015 at 6:31 AM, Ivan Žužak [email protected]
wrote:
axebox commentedon Jul 1, 2015
This isn't working for me. If I enable soft tabs I expect that to be the default. I shouldn't have to set tabs for every file I work with.
karljakober commentedon Jul 3, 2015
also broken for me, very annoying.
notarseniy commentedon Jul 10, 2015
I agree this bug :(
ck3g commentedon Jul 13, 2015
Same for me
SlimeQ commentedon Jul 15, 2015
same for me, makes writing python a nightmare
the checkbox in preferences is extremely misleading, sort of got it right by changing config
still, leading spaces are automatically grouped by 4, making it impossible to change my indent level to 2. this is weird behaviour to be sure
notarseniy commentedon Jul 15, 2015
@izuzak i think, we should reopen this.
ennoweichert commentedon Jul 18, 2015
This is a misfeature!
Soft tabs should never be the default behavior. At the very least tell us in the status line what's going on. Even if it's trying to auto-detect, this is too much magic. People rely on correct whitespace like they rely on correct encoding.
Changing user input like this is bad especially if it doesn't even announce itself.
I just learned about this while a heredoc was breaking and now I wonder how many files I may have contaminated.
Absolutely ridiculous!
10 remaining items
rasm200 commentedon Jun 13, 2016
This is my first time using Atom. When I tried to use emmet I faced the same problem that every one here, so, after trying with different options, at the end I found that using the keys combination ctrl+shift+enter is more confortable than traditional way, y recomended it, you will be seeing in real time how html will be rendered
jeffmcneill commentedon Jun 13, 2016
Most reports of issues seem to be closed without resolving the underlying problem. There is only one open I could find (on cursory clicking):
Closed
Open
The big issue as reported is the inaccurate "guessing" combined with the inability for an editor-wide setting (and not per-file setting). It may be that several preferences may be required instead of having one monolithic setting which is clearly causing unhappiness:
The idea would be to be able to re-order these in terms of priority, based on the needs of the user.
tetreault commentedon Dec 29, 2016
Please keep this open, its been a while since June and this is still a problem and I agree its about to make me switch away from atom its that annoying...
jkw commentedon Jan 6, 2017
Thought I was alone with this issue, but then I found this issue.
It isn't just the editor itself, seems to be some underlying code that causes it because not even the package tabs-to-spaces can convert tabs in a html-file to pure spaces.
I sure wish there was a never-ever-ever-ever use tabs ever in any file ever regarding of package settings thing to turn ON and then delete the code that shows the button.
JustinJKlein commentedon Feb 3, 2017
I have been struggling with this for a long time. I cannot get atom to do a soft tab with 2 spaces. It never, never, never does it. Incredibly frustrating to go through and set it in the editor and then follow this message chain and not find an answer that actually works. Otherwise, Atom is very nice if a bit slow at times. I guess its time to go back to sublime text.
skizot722 commentedon Feb 14, 2017
I was having this exact problem. Cursor would jump over like it was a hard tab, even find and replace using an actual tab would detect tabs all over the file. Then I found Atomic Soft Tabs option under Editor settings. It was ticked. I unticked it and now my problem seems to be solved. Very frustrating though.
tetreault commentedon Feb 14, 2017
I solved this problem by switching to Vim 3 months ago. haven't had a tab/space issue or my text editor crash yet! 👍💯🔥
miikaah commentedon Aug 30, 2017
Also make sure you've specified the correct indentation style for the file type if you are using .editorconfig .
eg:
[*]
indent_style = tab
[*.yml]
indent_style = space
indent_size = 2
brienwashburn commentedon Sep 1, 2017
+1 for skizot722 a couple comments up. Make certain that the option "Atomic Soft Tabs" is unchecked in Editor. I realized something was wrong when I ran the command (using Vim)
and nothing was replaced. I ran
and all the supposed tabs turned into 4 1's (I have tabwidth set to 4). Now when I hit delete on macOS it will actually go a space at a time.
spencer1573 commentedon Dec 17, 2017
ptytb commentedon Mar 22, 2018
Finally, all pieces together:
Editor / Atomic Soft Tabs = Off
Editor / Soft Tabs = On
Editor / Tab Length = 4
Editor / Tab Type = auto
Install auto-detect-indentation plugin
Replace existing tabs with spaces :%s/\t/ /g
Works like a charm.
Plus, Alt+Backspace Tab works like "==" (auto indent) in vim mode.
timsully commentedon Jul 29, 2018
@ptytb When you say "Replace existing tabs with spaces :%s/\t/ /g" where do I go to add this :%s/\t/ /g ? Or am I not understanding this correctly.
ptytb commentedon Jul 30, 2018
@timsully this command is supposed to be used in Vim mode (vim-mode-plus plugin). It has the same effect as hitting Ctrl-Shift-F and replacing space with \t in regexp mode.
lock commentedon Jan 26, 2019
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!