-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
End of line sequence changing sometimes #18518
Comments
Can please you try running code with |
I'll try but it is intermittent so I don't know how to trigger it. |
@BillDenton without additional information it is very hard to track this down. I will close the issue for now. If you can provide the information please ping and we will reopen the issue. |
Just had it happen again, but still no idea how. There doesn't seem to be a keybinding for it, so it can't have been accidental typing. I found the problem externally (when diffing using WinMerge). Checking using hexdump (https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-hexdump) shows that the affected file only has 0A at the end of the lines, whereas unaffected files have "0D 0A" at the end of lines. |
As I'm working in Windows nearly all of my source code files have windows line endings. However, we have some files that are imported into our project from an external source. The line endings in these files match the external source which is Unix line endings. When I open these files the line ending is immediately converted to Windows. This gives a dirty file, which when I close it prompts me to save it. I haven't any (manual) edits to this file. I'm hitting this problem a lot in the debugger as my program has a breakpoint in this file (to allow catching of an exit). |
This looks like a duplicate of Automatically detect encoding of the file opened, which may (hopefully) be in the February iteration plan. |
fyi @bpasero |
I cannot reproduce, I have 2 files on Windows, one using LF and one using CRLF and I can open each of them and the status bar shows the correct line endings and the files are not getting dirty out of the box. Please provide more info to reproduce. |
Just checked again using release build with extension; still fails. |
From the command line (NOT the integrated terminal in Code), execute: |
Checked with "code --disable-extensions" with release build and it doesn't occur. So must be an extension. I'll do some selective disabling to identify the extension.. |
In 1.10.1 I started using the original file that highlighted this problem. I'm not seeing the issue, but the file which has 0x0A line endings shows as Win32 in the status bar. Checked the line endings using hexdump . So it appears that the line end detection is broken. |
Steps to Reproduce:
This happened to me a few times. Working in Windows with Windows line endings.
The text was updated successfully, but these errors were encountered: