Soft tabs should follow tab stops


#1

If I have 2-space soft tabs set, I would expect pressing [TAB] to sometimes insert 1 space, or whatever is necessary to meet the next tab stop.

You can see below how I have to use [SPACE] to correctly meet the tab stop, where [TAB] will always insert 2 spaces, no matter where the tab stop is.

| | | | |   <~~ Tab stops
var a = 1;  
     ^----- [SPACE] Correct
var b  = 2; 
     ^----- [TAB] Incorrect

Let me know if there’s a repo I can modify to correct this behavior. Thanks!


Tabulators are not aligned correctly
Tab stops not rendering properly?
Tabulators are not aligned correctly
#2

I’m having an issue that is probably related in that hard tabs are not shown properly. They are all just rendered as the number of space characters I have set instead of just being as wide as the length to the next tab stop.

So when I’m using hard tabs and set tabs to be 8 characters wide I get this: http://puu.sh/7zWi1.png

While I would expect it to look more like this: http://puu.sh/7zWil.png


#3

I’m having the same problem, instead of all my comments being aligned perfectly, they all look randomly placed.


#4

I think this problem isn’t only related to Soft Tabs. I have deactivated the soft tabs option in the preferences, so tabulators are not replaced by spaces.

Same issue with ordinary tabulators.


#5

Yeah, this bug is/was really annoying for editing code with any kind of vertical alignment besides the indentation on the left. It didn’'t just affect typing tabs, but also displaying existing ones.

I just submitted a pull request with a fix, so hopefully that will fix hard tabs at least. I’m not sure what the expected behaviour for soft tabs would be, so I left that alone, for the moment.


#6

+1
I agree.
It’s difficult with a lot of code if the code is not aligned.


#7

+1 can’t write Haskell in Atom primarily because of this.

The Sublime Text behaviour (all kinds of tabs follow tab stops, soft tabs insert N spaces where N is the distance to the next tab stop) is perfect and well accepted.


#8

This has been fixed and should be available in the next version of Atom (v0.116.0):

Closing this topic as resolved. If there is a new wrinkle, please feel free to open a new topic.


#9