Author Topic: ViewSpecial - End Of Line  (Read 1126 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1843
  • Hero Points: 178
  • Text
ViewSpecial - End Of Line
« on: August 22, 2016, 10:04:17 pm »
It would be great if ViewSpecials would show something different for each of the various line endings.

CharactorDisplay As
^m<CR>
^j<LF>
^m^j<CRLF>

Currently it depends on the encoding and the buffer line-ending format.
As a user it is often difficult to dig this information out of Slick.


It helps now that LineHex seems to work with UTF-8 files -- turning on LineHex and ViewSpecials is the only reliable way I've found to get Slick to display what the real line endings are.




Oddly, LineHex still doesn't work for UTF-16 files.


jc44

  • Senior Community Member
  • Posts: 216
  • Hero Points: 15
Re: ViewSpecial - End Of Line
« Reply #1 on: August 23, 2016, 03:58:18 pm »
I don't know if it works for all file types but I have
EOL = 13
CR = 171
LF = 182

In the non-Unicode special chars setup and that gets me ¶ for cr, « for lf and «¶ for crlf.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4924
  • Hero Points: 402
Re: ViewSpecial - End Of Line
« Reply #2 on: August 23, 2016, 07:01:17 pm »
It would nice if Unicode view special characters allowed the different EOL sequences to be configure like you mention. Right now, <CR> and <LF> really means the file is probably bad/doesn't have consistent line endings. These defaults could be changed though. <CR><LF><CRLF> is much more obvious at the end of the line.

Line hex doesn't support Utf-16 or Utf-32 because there currently isn't any support for binary loading these files as lines of bytes where the end of line sequence isn't just bytes. Saving has the same limitation too. Keep in mind that all the load/save code is very optimized.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4924
  • Hero Points: 402
Re: ViewSpecial - End Of Line
« Reply #3 on: August 25, 2016, 03:50:48 pm »
How about if you set Unicode "End-Of-Line" to blank, then we just use the control characters you have defined for each of the end of line bytes (i.e.  ^M --> <CR>, ^J --> <LF>, ^M^J --> <CR><LF>)?

I like this better than displaying two bytes as a single character like <CRLF>.

jporkkahtc

  • Senior Community Member
  • Posts: 1843
  • Hero Points: 178
  • Text
Re: ViewSpecial - End Of Line
« Reply #4 on: August 25, 2016, 05:43:38 pm »
That would be great -- so would this happen only if I set End-of-line to blank, or would you just get rid of End-of-line?
Would this be for Unicode files only?


WRT consistent line endings: One of the big reasons I want this :-)  It should always show <CR> and <LF> no matter what the buffer LineEndings setting is.


It is interesting that if I do Ctrl+Q Ctrl+J it inserts an <LF> that isn't interpreted as an end of line until the buffer gets reloaded. OTOH, Ctrl+Q Ctrl+I doesn't do the same for tab. I'm guessing Slick must keep a list of line beginning points that doesn't get updated for Ctrl+Q Ctrl+J.



Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4924
  • Hero Points: 402
Re: ViewSpecial - End Of Line
« Reply #5 on: August 25, 2016, 06:22:15 pm »
There would still be a Unicode "End-Of-Line" setting but you would want it blank. I'm probably going to change my personal settings for this to be blank too.

I've made a similar change for SBCS/DBCS files. Just set Non-Unicode "End-Of-Line" to 13 or 10.

SlickEdit treats embedded new-line characters within a line slightly differently as you're seeing. This is very implementation specific. It most places (like paste and insert-literal), EOL characters are normalized and the line is split. Looks like quote_key() uses keyin() which doesn't do any of this.