What do smart tabs in WebStorm/PHPStorm do?

TabsFormattingPhpstormWebstorm

Tabs Problem Overview


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?

Tabs Solutions


Solution 1 - Tabs

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---}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMonkeyBonkeyView Question on Stackoverflow
Solution 1 - TabsbsryktView Answer on Stackoverflow