Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting "editor.tabSize" not working correctly #28277

Closed
linghu86 opened this issue Jun 9, 2017 · 7 comments
Closed

setting "editor.tabSize" not working correctly #28277

linghu86 opened this issue Jun 9, 2017 · 7 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@linghu86
Copy link

linghu86 commented Jun 9, 2017

  • VSCode Version:1.13
  • OS Version:Windows 10

Steps to Reproduce:

1.Set the option {"editor.tabSize": 2}
2.open a js file,then save it.you will see the "editor.tabSize" setting not working.

@vscodebot vscodebot bot added the new release label Jun 9, 2017
@linghu86 linghu86 changed the title config tabSize not working setting "editor.tabSize" not working correctly Jun 9, 2017
@secsilm
Copy link

secsilm commented Jun 10, 2017

Same issue. I have set "editor.tabSize": 4, but there is 2 spaces when I push TAB in a .py file.

  • VSCode Version: 1.13.0
  • OS Version:Windows 10

@alexdima
Copy link
Member

@linghu86 @secsilm Please note there are three settings affecting how VS Code deals with indentation:

screen shot 2017-06-12 at 09 09 43

When editor.detectIndentation is true (Default)

  • the files, when they are opened, are analysed, and if sufficient hints are present (e.g. the file is not empty, there are sufficient lines with indentation), VS Code will guess the indentation from the file.
  • if the file does not have sufficient hints (e.g. the file is empty), VS Code will use the values configured in editor.tabSize and editor.insertSpaces.
  • In both cases, the status bar entry at the bottom will show what VS Code uses. e.g. Spaces@4 or Tabs@4 etc.

When editor.detectIndentation is false

  • the values configured in editor.tabSize and editor.insertSpaces will be used.

Perhaps you would want to run with editor.detectIndentation: false ?

@alexdima alexdima added the info-needed Issue requires more information from poster label Jun 12, 2017
@linghu86
Copy link
Author

@alexandrudima

Still not working correctly.

First,Save My Setting,Like :
Setting

Create a new html file:
Create File

But when I save this file,the tab size still 4 spaces.
Save File

@alexdima
Copy link
Member

alexdima commented Jun 12, 2017

@linghu86 from your screenshot, it appears the editor is correctly picking up your settings (See the Spaces: 2) in the status bar.

  • Do you perhaps have installed some extension that might decide to "format on save" HTML files with incorrect indentation settings? Can you reproduce when running code --disable-extensions ?
  • Does this happen for any file type (e.g. .txt file) or only for specific files (i.e. .html) ?

@secsilm
Copy link

secsilm commented Jun 12, 2017

@alexandrudima My problem is solved while I don't do anything. I don't konw what's going on. So weird.

@linghu86
Copy link
Author

@secsilm
This problem is caused by other extensions
After I uninstalled several extensions, I solved the problem

@alexandrudima Thanks.

@whxaxes
Copy link

whxaxes commented Jul 13, 2017

@linghu86 I just met the same problem, and I found it caused by JS-CSS-HTML Formatter, you could change the formatter config to solved the problem. F1 => formatter config => change indent_size => restart vscode.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants