Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CR in a LF scripts unexpectly replaced by LF #149433

Closed
chensln opened this issue May 13, 2022 · 1 comment
Closed

CR in a LF scripts unexpectly replaced by LF #149433

chensln opened this issue May 13, 2022 · 1 comment
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@chensln
Copy link

chensln commented May 13, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:1.68.0-insider (user setup)
  • OS Version:Windows_NT x64 6.1.7601

Steps to Reproduce:

1.create a file, line end with LF and contain CR.
i.e. echo -e 'aaa\rbbb\nccc\n' > 1
image
2. edit with vscode, input or delete words
image
3.save
4.CR was replaced by LF.
image

usually, this replacement takes no effect. but I have a shell script in which CR is a separator of awk command. once CR was replaced by LF, the script run into error.

@alexdima
Copy link
Member

alexdima commented May 13, 2022

VS Code is currently very opinionated about line endings and tries to "fix them" as best as possible to make the problem of mixed line endings a thing of the past. This, however, comes at the cost that it ends up touching areas of the text buffer that are not edited directly.

I suggest we track this in not identical, but similar issues, #127 or #35797 .

@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label May 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants