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

Detect Indentation setting removes single space on indent #61442

Closed
kwaschny opened this issue Oct 21, 2018 · 4 comments
Closed

Detect Indentation setting removes single space on indent #61442

kwaschny opened this issue Oct 21, 2018 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues
Milestone

Comments

@kwaschny
Copy link

  • VSCode Version: 1.28.2
  • core setting, not extension related

demo

Settings
Detect Indentation: true
Tab Size: 4

Description
Indenting lines that contain a single space (within the indentation whitespaces) will remove the space, i.e. consider the space as part of an indent level.

Background
When minifying HTML output by removing all newlines, a single space is used to separate multiline attributes. Identing present code removes all spaces and breaks it as demonstrated in the above gif.

Proposal
Unless Tab Size is set to 1, a single space (within tabs) should not be considered as indentation level and stay untouched while the Detect Indentation mode is enabled.

@vscodebot
Copy link

vscodebot bot commented Oct 21, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@Tyriar Tyriar added the editor-autoindent Editor auto indentation issues label Oct 22, 2018
@vscodebot vscodebot bot removed the new release label Oct 22, 2018
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Aug 2, 2019
@rebornix
Copy link
Member

rebornix commented Aug 5, 2019

It's controlled by editor.autoIndent, which attempts to align the indentation when you do Tab. You can turn this option off if it doesn't work as needed.

@rebornix rebornix closed this as completed Aug 5, 2019
@rebornix rebornix added under-discussion Issue is under discussion for relevance, priority, approach and removed bug Issue identified by VS Code Team member as probable bug labels Aug 5, 2019
@kwaschny
Copy link
Author

kwaschny commented Aug 5, 2019

@rebornix Did you test your proposal? Because "editor.autoIndent": false doesn't change the behavior. (tested in 1.36.1)

@rebornix
Copy link
Member

rebornix commented Aug 5, 2019

@kwaschny good catch ;) It should work with "editor.autoIndent": false .

@rebornix rebornix added bug Issue identified by VS Code Team member as probable bug and removed under-discussion Issue is under discussion for relevance, priority, approach labels Aug 5, 2019
@rebornix rebornix added this to the On Deck milestone Aug 5, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues
Projects
None yet
Development

No branches or pull requests

3 participants