PowerShell / PowerShell/vscode-powershell
InsertText method inserts lone carriage return characters as new lines.
Open
Nobody has claimed this yet.
Area-psEditor
Issue-Bug
OS-Windows
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 547
- PR merge metrics
- No merged PRs in 30d
Description
Steps to reproduce
-
Open a existing script file with CRLF end of line sequence.
-
Move cursor to the end of the file.
-
In the integrated console run
$chars = $psEditor.GetEditorContext().CurrentFile.GetText().ToCharArray()
$chars.ForEach{
$psEditor.GetEditorContext().CurrentFile.InsertText($PSItem)
Start-Sleep -Milliseconds 50
}
The file will be reproduced character by character, but with double lines.
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
Reproduce the issue by opening a CRLF script, moving to the end, and running the provided PowerShell snippet in the integrated console. Start by tracing the InsertText behavior used by CurrentFile; done means reproducing the file character by character without lone carriage returns creating extra lines.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100