Skip to content

Auto detect indentation when pasting on an empty file#156282

Merged
alexdima merged 2 commits intomicrosoft:mainfrom
Balastrong:feature/auto-detect-indentation
Oct 24, 2022
Merged

Auto detect indentation when pasting on an empty file#156282
alexdima merged 2 commits intomicrosoft:mainfrom
Balastrong:feature/auto-detect-indentation

Conversation

@Balastrong
Copy link
Contributor

This PR fixes #151304.

While working on it I noticed that it does not detect tab size (sets 4 as default) but only space size, and seems to be intentional:

let tabSize = defaultTabSize;
// Guess tabSize only if inserting spaces...
if (insertSpaces) {

I'm mentioning that in case we want to change this behavior as I don't know why originally it has been decided.

@alexdima alexdima added this to the October 2022 milestone Oct 24, 2022
@alexdima alexdima merged commit 526ea7d into microsoft:main Oct 24, 2022
@Balastrong Balastrong deleted the feature/auto-detect-indentation branch October 24, 2022 19:08
formigoni pushed a commit to formigoni/vscode that referenced this pull request Oct 27, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect Indentation automatically after creating a new file and paste some code into it

4 participants