Schlagges
Schlagges

Reputation: 61

Prevent Visual Studio Code from replacing tabs with spaces on save

My problem is not present while editing a file, like here: Spaces to tabs in Visual Studio Code

VSC converts all tabs to spaces when I save the file. How could I stop that stupid behavior?

This are my actual user settings:

{
    "editor.insertSpaces": false,
    "editor.detectIndentation": false
}

Further informations:

 "editor.formatOnSave": false

Upvotes: 3

Views: 6276

Answers (2)

Navelgazer
Navelgazer

Reputation: 455

Wish I understood more about what's happening here, but in my case, what finally worked (for now) was unchecking "Editor: Insert Spaces" in my user prefs. Without this, disabling Save on Format didn't seem to help. ¯\_(ツ)_/¯

screenshot of the "Editor: Insert Spaces" setting, unchecked

Upvotes: 5

Schlagges
Schlagges

Reputation: 61

I had an extension which overrides the default behaviour:

https://marketplace.visualstudio.com/items?itemName=lonefy.vscode-JS-CSS-HTML-formatter

Upvotes: 2

Related Questions