当前Release修改了下工程包引用和发布目标,让它支持vs2022.
=============== End of the Line is a Visual Studio extension that shows end of line markers in text editor allowing users to differentiate between CR LF and LF line endings.
Visual Studio provides the Edit ▸ Advanced ▸ View White Space (Ctrl+R, Ctrl+W) option to visualize spaces and tabs. Unfortunately this option does not visualize line break characters such as carrage returns (CR) and line feeds (LF). The End of the Line is a Visual Studio extension fixes this. When used it will CR and LF characters as ¤ and ¶ respectively using the same font style as Visual Studio displays spaces and tabs in.
After installing the extension be sure to enable "View White Space" (Ctrl+R, Ctrl+W) to see the end of line markers in the text editor or specify when you wish line endings to be visible in Tools ▸ Options... ▸ End of the Line. If you encounter any difficulties take a look at the troubleshooting guide.
You can use Edit ▸ Advanced ▸ Make line endings CR LF (Ctrl+R, Ctrl+C), or Edit ▸ Advanced ▸ Make line endings LF (Ctrl+R, Ctrl+L) to change the line endings for the document as a whole or for the text selection if any.
Have you ever wondered why Visual Studio starts showing the Inconsistent Line Endings when you open a file, even though you've only ever used Visual Studio to edit the file? Detecting where these inconsistent line endings originate from is a lot easier when you're able to see the line endings while editing the file. Common ways in which inconsistent line endings gets introduced is:
- Copying and pasting code from a file with different line endings.
- Using Visual Studio extensions that always assumes CR LF endings to reformat regions of code.
Features:
- Support VS2017 (15.0).
- Support configuring line endings to show up in the color used for errors.
Features:
- Add Options page for configuring visibility policy and line ending representation.
Features:
- Support VS2015 (14.0).
Bug fixes:
- EOL markers sometimes vanished when part of compound editing operation.
Features:
- Editing commands for changing line endings.
Features:
- Only show EOL markers when show whitespace is active.
- Support VS2012 in addition to VS2013.
Bug fixes:
- EOL marker on first view line vanished when editing second line.
- Initial release
Contributors in the order of first contribution
If you just want to locate places where files change from one line ending type to another, or you want to quickly check all the files in the whole solution, you can do a text search using the following regular expression:
\r\n.*[^\r]\n|[^\r]\n.*\r\n
For example, to find the locations of all line ending consistencies in the solution, do the following:
- Press Ctrl+Shift+F (Edit ▸ Find and Replace ▸ Find in Files)
- Enter
\r\n.*[^\r]\n|[^\r]\n.*\r\n
into the "Find what:" edit box. - Turn on "Find options" ▸ "Use Regular Expressions".
- Press the "Find All" button.
This will give you a find results window containing something like this:
Find all "\r\n.*[^\r]\n|[^\r]\n.*\r\n", Regular expressions, Subfolders, Find Results 1, Entire Solution, ""
C:\...\ConsoleApplication1\Other.cs(1):using System;
C:\...\ConsoleApplication1\Other.cs(2):using System.Collections.Generic;
C:\...\ConsoleApplication1\Program.cs(9): class Program
C:\...\Program.cs(11): static void Main(string[] args)
Matching lines: 4 Matching files: 2 Total files searched: 4
You can also use the same regular expression to find inconsistencies within a single file.
Here are two Visual Studio extensions that provide the ability to change line endings on the fly when saving files:
- Strip'em
- Editor Config
I (Rolf) have used Editor Config myself in the past to keep source code trees consistent across different platforms. I have no experience with Strip'em.