I solve the problem like this.
First do not use mix tabs and spaces in the files. Use spaces only. Sublime can finely handle the indentation without a hard tab character.
Setup Sublime Text 2 to use spaces only:
// Tab and whitespace handling.
// Indent using spaces, 4 spaces ber indent by default, clean up extra whitespaces on save
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
"trim_trailing_white_space_on_save": true,
// Do not try to detect the tab size from the opened file
"detect_indentation" : false,
If you encounter any old files with mixed tabs and spaces you can convert them to spaces only from View > Indentation > Convert tabs to spaces menu.
Why tab character is bad in your source code