VSCode switches from indent-with-tabs to indent-with-spaces incorrectly
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
This is affecting me on MacOS X. It may be reproducible on Linux. I don't know an easy way to reproduce this on Windows since it doesn't have printf ...
Steps to reproduce:
- Create a new buffer. Set it to "Indent Using Tabs", tab size 4.
- Invoke this:
:%!printf "\tfoo\t\bar" - Observe that the VSCode buffer is now set to indent using 4 spaces, and the contents of the buffer are now
____foo\tbar(where_is a space).
Expected:
The buffer should contain \tfoo\tbar where \t are tabs. There should be NO spaces in the buffer. And, the buffer should still be "Tab Size: 4" and not "Spaces: 4".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Reproduce the behavior in VSCode on macOS with a new buffer, Indent Using Tabs, tab size 4, and :%!printf "\tfoo\t\bar"; trace the buffer and indentation handling involved. Done means the buffer retains tabs and remains set to tabs with size 4.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100