VSCodeVim / VSCodeVim/Vim

VSCode switches from indent-with-tabs to indent-with-spaces incorrectly

Open
#4,331 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. Create a new buffer. Set it to "Indent Using Tabs", tab size 4.
  2. Invoke this: :%!printf "\tfoo\t\bar"
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.