Home Download Buy Blog Forum Support

Display line endings, line by line, like in Scintilla

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

Postby skuroda on Sun Mar 10, 2013 8:59 pm

robertcollier4 wrote: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.


But isn't this not really an issue since ST saves the entire buffer with the specified line ending anyways? You could mix the two, but upon save, all line endings will be the same (whatever is specified). Or maybe I am missing something?
skuroda
 
Posts: 683
Joined: Fri Oct 05, 2012 8:11 am

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

Postby bmanam on Tue Mar 12, 2013 10:51 am

+1 here too. I have it on almost permanently in Notepad++ & am tired of switching back and forth just to verify the line endings for files sent to me that have been created on Linux.
bmanam
 
Posts: 3
Joined: Tue Mar 12, 2013 10:48 am

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

Postby bizoo on Tue Mar 12, 2013 11:22 am

bmanam wrote:+1 here too. I have it on almost permanently in Notepad++ & am tired of switching back and forth just to verify the line endings for files sent to me that have been created on Linux.

Did you read the previous post ? What do you want to verify ?
You can check the line endings in the menu View -> Line Endings.
And there's no mixed line endings in a view, ST normalize them when loading the file.

If you want to mix line endings in a file, you must use another editor.
bizoo
 
Posts: 880
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

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

Postby bmanam on Tue Mar 12, 2013 1:19 pm

Alright then. Leaving aside the fact that an option would reside in the view menu which has no visual effect when changed, I'll put this one to bed. Automatic normalization of line endings will do.
bmanam
 
Posts: 3
Joined: Tue Mar 12, 2013 10:48 am

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

Postby bizoo on Tue Mar 12, 2013 1:45 pm

bmanam wrote:Alright then. Leaving aside the fact that an option would reside in the view menu which has no visual effect when changed

Take a look at https://github.com/SublimeText/LineEndings
Also available at Package Control.
bizoo
 
Posts: 880
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

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

Postby chief1983 on Mon Apr 15, 2013 4:24 pm

I registered here, just to give the use case I commonly run into for needing to see line endings. If you don't already know why this is important, and why I have to keep Komodo Edit around on OS X, then you've probably not done a lot of cross-platform development involving patches before. I work with a Windows/OS X/Linux project, and there are patch files created by TortoiseSVN users, *nix command line SVN users, etc. Most of the files in the repo are forced to LF, but the project files for Windows are all CRLF endings, and occasionally a new file gets committed and doesn't get a propset applied to force it to LF because Windows coders ain't got time for that. So you then end up with large patches that have a mix of LF or CRLF in the diff-specific lines, as well as in the content. Command line diff tries to remove all trailing CRs if it thinks they're only there because the diff came from Windows, but if some of those files were also Windows files, it just ruined their diff. My point is, as far as the diff utilities are concerned, these mixed ending files are completely valid, and a text editor capable of displaying them exactly as-is is not only helpful, but required for working with them at times. I'd like to stop having to fire up Komodo every time I need to edit one. If ST is going to trash that data just by opening and saving a patch file, then it's useless to me for viewing/editing patch files and I'll have to keep Komodo around. It's still looking to replace Aptana as my PHP development environment though.
chief1983
 
Posts: 1
Joined: Mon Apr 15, 2013 4:13 pm

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

Postby facelessuser on Tue Apr 16, 2013 12:06 am

This could be coded up in a plugin. You could run the command on a view, and the view would be manually reloaded showing all carriage returns. While in this raw line edit mode, you could look at the line endings and enter new ones: maybe enter gives you unix, and shift+enter gives you windows style. I have a plugin locally on my machine that can do this (the user interface needs a little work), but if you are interested, I may try to revive it and hammer out the issues to make it usable. It would currently be for ST3. Anyways, just thought I'd share.
facelessuser
 
Posts: 1571
Joined: Tue Apr 05, 2011 7:38 pm

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

Postby MKANET on Wed Sep 18, 2013 4:25 pm

I know this may sound like a stupid question, but how do I "manually read in a file and populate the view buffer" with ST3? All I need to do is verify/be certain line ends are unix-style instead of Windows or visa-versa.

facelessuser wrote: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


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.
MKANET
 
Posts: 56
Joined: Fri Aug 30, 2013 5:06 pm

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

Postby facelessuser on Wed Sep 18, 2013 8:04 pm

MKANET wrote:I know this may sound like a stupid question, but how do I "manually read in a file and populate the view buffer" with ST3? All I need to do is verify/be certain line ends are unix-style instead of Windows or visa-versa.


I had decided to code up a simple plugin to do this (it expects files to be UTF-8 though...I know, I should get off my butt and make it more more friendly to other encodings...but I am also lazy).

https://github.com/facelessuser/RawLineEdit
facelessuser
 
Posts: 1571
Joined: Tue Apr 05, 2011 7:38 pm

Previous

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 4 guests