Home Download Buy Blog Forum Support

Display line endings, line by line, like in Scintilla

Display line endings, line by line, like in Scintilla

Postby Jerome on Thu Jul 19, 2012 1:00 pm

Hi,

Is it possible to add the possibility to show line endings like in Scintilla?

Image

After each line see special chars [LF] or [CR] or [CR][LF]

It's usefull to see, line by line the line ending char(s)

Thanks,
Jerome
Jerome
 
Posts: 4
Joined: Tue Jul 03, 2012 6:26 am

Re: Display line endings, line by line, like in Scintilla

Postby Philippe on Thu Jul 19, 2012 1:02 pm

+1 for this common feature in Windows editors... very handy at times.
Philippe
 
Posts: 4
Joined: Sat Jan 29, 2011 8:10 pm

Re: Display line endings, line by line, like in Scintilla

Postby Callidus on Tue Aug 21, 2012 3:49 pm

+1 from me also. I need to know clearly if there is a CR vs CR LF. I use text editors to view and manipulate data files quite often, and the distinction is significant. Scintilla displays them exactly like Notepad++ and that's precisely what i need.
Callidus
 
Posts: 3
Joined: Tue Aug 21, 2012 3:00 pm

Re: Display line endings, line by line, like in Scintilla

Postby pho3nixf1re on Wed Sep 19, 2012 6:33 pm

Could this be implemented in a plugin? I'm not familiar with the API, but would take the challenge on if it is possible.
pho3nixf1re
 
Posts: 1
Joined: Thu Jun 07, 2012 4:35 pm

Re: Display line endings, line by line, like in Scintilla

Postby Elijah Lynn on Thu Dec 13, 2012 4:02 pm

This would be awesome! Anyone know how to do this? I have a hard time believing this isn't already in SL?
Elijah Lynn
 
Posts: 1
Joined: Thu Dec 13, 2012 4:02 pm

Re: Display line endings, line by line, like in Scintilla

Postby agibsonsw on Thu Dec 13, 2012 4:33 pm

If you don't want these displaying permanently then you could just use Find and Find All using the regex '\n' and/or '\r\n'. This allows you to scroll up and down but, of course, you could use Replace as well.

While this may be possible via a plug-in I suspect it will muck up all the scoping rules.
Attachments
newline.png
newline.png (20.63 KiB) Viewed 10279 times
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Display line endings, line by line, like in Scintilla

Postby skuroda on Fri Dec 14, 2012 1:08 am

As of now, I don't think this can be done (even via plugin). From what I have seen, and a quick search of the issue pointing me here, Sublime Text normalizes line endings to "\n" when the file is loaded (I verified this as a file I created with "\r\n" did not contain any "\r" characters when I did a regex find). When the file is saved, all line endings are converted to what ever is specified (or opened with). I tested this by creating a file containing both line endings, opening it in Sublime Text, making some modification and saving it. So good news, when you save in Sublime, all the line endings should be consistent, bad news, you can't actually see individual line endings.
skuroda
 
Posts: 690
Joined: Fri Oct 05, 2012 8:11 am

Re: Display line endings, line by line, like in Scintilla

Postby robertcollier4 on Sat Mar 09, 2013 4:12 am

+1 to also show CR and LF. Or add a preference for draw_white_space_lineendings.

This is a duplicate of Forum Post - Show tabs, white spaces, line breaks
Also vote for this on Userecho - Is it possible to Show all characters (spaces, TABs, CR, LF, etc.)
robertcollier4
 
Posts: 154
Joined: Sun Feb 24, 2013 5:37 pm

Re: Display line endings, line by line, like in Scintilla

Postby facelessuser on Sun Mar 10, 2013 5:11 pm

Technically ST3 can display carriage returns as is...if you manually read in a file and populate the view buffer...

This is in Sublime Text 3 when a file is manually read in and populated to the view buffer:
Screen Shot 2013-03-10 at 10.38.44 AM.png
Screen Shot 2013-03-10 at 10.38.44 AM.png (39.03 KiB) Viewed 9350 times


I realize opinions differ on whether it is really needed to show carriage returns and line feeds, but really I am just showing that Sublime Text can technically show carriage returns. Line feeds seems redundant since you can see the line on the next line number, but again, opinions differ on this.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: Display line endings, line by line, like in Scintilla

Postby robertcollier4 on Sun Mar 10, 2013 5:49 pm

The reason to want to see both CR and LF is if I may be reading some wierd file that was maybe created-edited with a mixture of buggy Unix and Windows editors so that the file might contain a mixture of CR-LF and CR or other line endings structures. It is sometimes nice to see what is exactly going on with the file.
robertcollier4
 
Posts: 154
Joined: Sun Feb 24, 2013 5:37 pm

Next

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 9 guests