What do smart tabs in WebStorm/PHPStorm do?

MonkeyBonkey picture MonkeyBonkey · Nov 26, 2012 · Viewed 11.2k times · Source

I'm confused as to what smart tabs do in general preferences.

It says that:

Fine alignment to a necessary column is done only via spaces... If this check box is not selected, then spaces are used for alignment if necessary...

Doesn't that mean that spaces are used in alignment for both cases? Does it mean that it always uses spaces in the latter and only sometimes in the former?

Can someone illustrate with an example of the two cases?

Answer

bsrykt picture bsrykt · Apr 11, 2013

If smart tabs option is enabled then only spaces are used for alignment, else tabs and spaces are used.

e.g: for the following code block

    function(first, 
             second) {
    }

without smart tabs

t---function(first, 
t---t---t---.second) {
t---}

with smart tabs

t---function(first, 
t---.........second) {
t---}