Skip to content
Discussion options

You must be logged in to vote

Do you want the line ending that should be used, or the line ending that is actually used? For example, the document could be using LF, but the editor settings or EditorConfig file says that the line endings should be CRLF.

There's a few options (code samples of each are at the bottom).

IEditorOptions

If you want the line ending that should be used, then you could look at the document's options. Get your hands on an ITextBuffer, then get the IEditorOptions from its properties. There's a GetNewLineCharacter() extension method that provides the line ending that should be used in the document.

Important

Having used this, I think this option is only what Visual Studio is configured to use, be…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lsoft
Comment options

Answer selected by lsoft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants