-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Search and replace across files corrupts files with CR line endings #48063
Comments
It looks like those files have CR-only line endings, which we don't support well: #35797 |
How do line endings impact this? I'm not talking about how line endings may have been munged by the search and replace. I'm talking about how instead of replacing "LICENSE.txt" with "LICENSE", it replaced an entire line that didn't even include "LICENSE.txt" on it. |
The search tool doesn't consider them line endings, so it reports a match on line 1, and the editor clobbers the CR line endings, and things are out of sync... looking at the code again, I can handle it in a less destructive way, either by not reporting the match or not applying the replace. |
Issue Type: Bug
Execute these commands:
git clone https://github.com/AArnott/pinvoke.git cd pinvoke git checkout b1239bc075f87f202a410973d7faa468a5e6b9cf code .
In the Search panel, search for "LICENSE.txt" and replace with "LICENSE" (no other options such as regex are selected).
In the search and replace results (before commiting them), notice how the second line of most source files has a small change applied. This is good.
But notice how 4 files have an erroneous change applied to the first line:
VS Code version: Code 1.22.1 (950b8b0, 2018-04-06T02:26:57.615Z)
OS version: Windows_NT x64 10.0.16299
System Info
Extensions (16)
The text was updated successfully, but these errors were encountered: