Home Download Buy Blog Forum Support

Edit/View Raw Line Endings (is this wanted?)

Edit/View Raw Line Endings (is this wanted?)

Postby facelessuser on Wed Apr 17, 2013 5:17 pm

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).

Is anyone actually interested in this?

This is what it looks like:
Image
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: Edit/View Raw Line Endings (is this wanted?)

Postby nullifi on Wed Apr 17, 2013 6:35 pm

I would be interested in this. I've ran into issues with line endings when copying/pasting code that I write in sublime and paste into a shell.
nullifi
 
Posts: 8
Joined: Wed Feb 22, 2012 6:20 pm

Re: Edit/View Raw Line Endings (is this wanted?)

Postby gekko on Mon Apr 22, 2013 10:50 am

I'm also interested but I just want to be able to view the line endings.
gekko
 
Posts: 9
Joined: Mon Aug 27, 2012 8:29 am

Re: Edit/View Raw Line Endings (is this wanted?)

Postby facelessuser on Mon Apr 22, 2013 6:26 pm

Check out the plugin at viewtopic.php?f=5&t=12050.

If you know you only want view only capability, I just added a setting called "view_only", that will popup a output panel with the line ending view.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: Edit/View Raw Line Endings (is this wanted?)

Postby gekko on Tue Apr 23, 2013 12:15 pm

Thank you!

The only thing that doesn't work for me is the colorization.
I've copied the color definitions from https://github.com/facelessuser/RawLineEdit into my own theme and it still displays it in black.

Edit: OK. It wasn't working because I set

Code: Select all
"use_raw_line_edit_theme": false


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
 
Posts: 9
Joined: Mon Aug 27, 2012 8:29 am

Re: Edit/View Raw Line Endings (is this wanted?)

Postby facelessuser on Tue Apr 23, 2013 3:41 pm

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.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: Edit/View Raw Line Endings (is this wanted?)

Postby FichteFoll on Mon May 06, 2013 1:11 am

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.
FichteFoll
 
Posts: 388
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Edit/View Raw Line Endings (is this wanted?)

Postby facelessuser on Mon May 06, 2013 1:38 am

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.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: Edit/View Raw Line Endings (is this wanted?)

Postby FichteFoll on Mon May 06, 2013 1:56 am

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.
FichteFoll
 
Posts: 388
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Edit/View Raw Line Endings (is this wanted?)

Postby facelessuser on Mon May 06, 2013 2:03 am

ST does strip CRs, it is only when you read the file and populate a view yourself, that the CR stripping gets bypassed, and then you realize that ST can show CRs just fine.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 9 guests