Replace tabs with spaces and add 'New Function' snippet #15

wants to merge 2 commits into


None yet

5 participants


No description provided.


We should not assume a default indentation of 4 spaces. A tab is relevant because according to user
s indentation settings, it can expand to 2 or 4 spaces or remain a tab character. For me python's indentation is 2 spaces, so this will break the code for me.

We should leave the tabs as it.


We should leave the tabs as it.



Ok, maybe you are right, but for now Atom doesn't expand tabs to spaces.

When I use class snippet I'm getting tab chars with 2 spaces length.

2014-03-05 08 49 22

Also, PEP8 recommend using 4 spaces to indent.


That is weird. I did not use the class snippet. I was using the defs snippet which was nicely expanding tabs to spaces for me. Even here you'll notice that in the first line, the tab was expanded into spaces. That is weird because language-python.cson uses tabs everywhere and no spaces at all.


Can you try it yourself?


Same for me. First line has spaces. Others have tab.


I'll create issue for this stuff.


Same result with try.
capture decran 2014-03-07 a 11 12 57
I think all python snippets with multiple tab will have the same render.

I wrote a reponse on your #17 issue.

Atom member

Hard tabs \t should be used in snippets. The snippets package normalizes them to either hard tabs or soft tabs and uses the tab length based on the editor settings when the snippet is expanded.

There was initially a bug in the core editor API where only the first tab was being normalized when expanded. This has been fixed in the 0.72.0 Atom release which was just pushed out.

I'm going to close this out since it should be resolved by the fixes to core and should not need to be updated further.

@yuriihabrusiev yuriihabrusiev deleted the unknown repository branch Mar 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment