So I have written a plugin that can allow you to view a file's raw line endings. You can also change the new line of whatever line the cursor is on, or lines that are selected. Enter is newline and Shift+Enter is Carriage return and new newline. (This would be for ST3 only).

The reason was that I wanted to leave the cource code colorization intact.Is there a way to have both - the colorization of the line endings and the default colorization of the editor without messing with default tmLanguage files?

gekko wrote:The reason was that I wanted to leave the cource code colorization intact.Is there a way to have both - the colorization of the line endings and the default colorization of the editor without messing with default tmLanguage files?

Sadly, no...well, if you modify your theme to scope new lines and carriage returns, then yes, but that is a lot of work for every language you want to do that with. That is why it has a special theme for new lines, it is really the easiest way for me to provide high visibility for new lines without providing a custom language file for every language in existence.

Thought of using add_regions? It can only change the background color, yeah, but you're doing that for CR anyway and the drawback for not being able to see the normal syntax highlighting is kinda huge.

Well, thinking more about it, the problem is that it can break these syntaxes because you are inserting characters at (for the parser/compiler) random points which the syntax definition can't consider, obviously. Hmm.

You are mistaken about what I am doing, I am not using add regions for CR, that is just how the CR character looks in sublime. Take a look at the code, all I do is read the file raw, and sublime shows the glyph for CR. I then add in a glyph for newline even necessary. I may go into specifics when I have more time.

To be honest I didn't get the code in the few minutes I looked at it so I thought you just inserted "CR" (the literals) and the tmLanguage made it look fancy but looking at it again your tmTheme only defines foreground colors so that's not the case.You don't have to go into detail, I can do that myself by actually reading the code when I want to, but I don't really have a need for this right now.

Still, I am kind of surprised that ST can actually show a CR, I thought it was escaping/masking these all the way.