]p and [p don't respect editor.detectIndentation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
The commands [p and ]p always indent with tabs even if the file uses spaces and editor.detectIndentation is enabled.
To Reproduce
Steps to reproduce the behavior:
- Open a files that uses spaces for indentation
- Yank a line via
yy - Move cursor to a line with indentation
- Put the yanked line at same indentation as the current line via
]por[p
Expected behavior
If editor.detectIndentation is enabled, [p and ]p should always use the same indentation characters as the current file. This matches the behavior of other commands such as o.
Environment (please complete the following information):
Extension version: 1.24.3
VS Code version: Code 1.73.1 (Universal) (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T02:08:38.961Z)
OS version: Darwin x64 21.6.0
Modes:
Sandboxed: No
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
Start by tracing the [p and ]p command handlers and compare their indentation behavior with o when editor.detectIndentation is enabled. Reproduce the reported steps with a spaces-indented file, then verify that [p and ]p preserve the file's indentation characters while placing the yanked line at the current indentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100