Author Topic: Line splitting  (Read 1357 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1844
  • Hero Points: 179
  • Text
Line splitting
« on: December 02, 2016, 07:59:53 pm »
"Wrap Line Length" will display really long lines as separate lines, but doesn't insert newline characters.


A manual way to split lines like this would be great.


Lately I've been looking at log files with really long compiler cmd lines.
I frequently do a search&Replace " " -> "\n" to make it readable -- but then I have to undo it to make it executable.


A way to insert line-splits for display, without inserting newlines would be awesome.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4924
  • Hero Points: 402
Re: Line splitting
« Reply #1 on: December 03, 2016, 10:18:10 pm »
isn't softwrap good enough?

jporkkahtc

  • Senior Community Member
  • Posts: 1844
  • Hero Points: 179
  • Text
Re: Line splitting
« Reply #2 on: December 04, 2016, 01:57:38 am »
Nope, because it is based on some fixed length.

I've got 3 cases I've been running into commonly.
1st: Windows style string (like PATH):
    C:\foo\bar;C:\windows\system32;C:\....

2nd: Linux style, same idea but using : instead of ;

3rd: Command lines in log files - where the command line can be 2K to 10K characters (really long gcc command lines - specifying include paths, etc...).

What I've been doing to work with this is to Search&Replace the separator character (space, : or ; commonly), with \R -- then its much easier to read and edit.
Then later I can again do a S&R from \R back to the separator.

I was thinking that Slick could make this a lot easier.

It seems to already have the ability to arbitrarily wrap lines without inserting EOL character: It does this on load for really long lines.
Being able to insert such line breaks (say, with ctrl+enter and/or a special non-character in the regex like \R) would be really helpful.
Then I could do a S&R from ";" to ";\Z", it would visually split the line into short pieces without adding any actual characters.




warnerrs

  • Senior Community Member
  • Posts: 114
  • Hero Points: 4
Re: Line splitting
« Reply #3 on: December 06, 2016, 02:40:23 am »
You'd like a delimiter based soft wrap, instead of a window width based soft wrap. That would be quit handy when working with generated log files that I can't resave. If I'm dealing with my own scripts or logs I can usually split things by escaping the newline and resave without any ill consequences.

eg. change
Quote
/path/to/a:/path/to/b:/path/to/c
to
Quote
/path/to/a:\
/path/to/b:\
/path/to/c:
And then just save it that way.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4924
  • Hero Points: 402
Re: Line splitting
« Reply #4 on: December 06, 2016, 08:23:26 am »
Delimiter based softwrap would work better than inserting fake line breaks. That way you could auto-restore the file and it would look the same.

jporkkahtc

  • Senior Community Member
  • Posts: 1844
  • Hero Points: 179
  • Text
Re: Line splitting
« Reply #5 on: December 06, 2016, 11:02:56 pm »
Would it have to wrap the entire file, or could you select a line or two and just split those?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4924
  • Hero Points: 402
Re: Line splitting
« Reply #6 on: December 06, 2016, 11:09:26 pm »
Softwrap is global. Done when screen is displayed.