0

I can't seem to get the Sublime Text 2 SublimeLinter package to stop showing the "Mixed tabs and spaces" warning.

I've set "smarttabs" : true in the settings, but it's still not taking.

Has anyone else solved this problem yet?

Here's my user settings for the SublimeLinter package: https://gist.github.com/3737558

Thanks.

evanmcd
  • 1,967
  • 3
  • 32
  • 52

2 Answers2

3

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

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
0

i have the same problem, maybe i found the reason

the smarttabsoptions can control the warning when space after tab, but can't control the warning tabs after the space, you can try it

if you want to disable the warning you can add a comment at top top of the file

/*jshint -W099*/

GilbertSun
  • 600
  • 5
  • 9