2nd line in multi-line script (1st indented) "not valid"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by bdeshi »

Apparently the line format update was not applied when saving in ST.
This might help: https://sublime.wbond.net/packages/Line ... gs%20Unify
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

aliteralmind
Posts: 261
Joined: 02 Dec 2014 16:49

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by aliteralmind »

That's a manual tool. It's not automatic.

Code: Select all

Line Endings Unify:
------------------

  ## Line Endings Unify
  
  change files endings (`Mac`,`Unix`,`Windows`) to `Unix` (aka `\n`).  (windows with sublime3 will be `Windows` (aka `\r\n`))
  
  ## How to use:
  
   - drag folder to sublime
   - use `cmd+shift+P` then `Line Endings Unify`
   - or bind some key in your user key binding:
    ```js
      {
  	 "keys": ["ctrl+alt+shift+l"],
  	 "command": "line_endings_unify"
  	}
    ```
   - check file extentions to be handled
   - done
  
  **always backup your data**
There's also "LineEndings", but it doesn't seem to do anything. Hasn't been updated in eleven months, and no documentation.
Windows 8.1, 64-bit

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by bdeshi »

Okay, no need to hunt down packages.
You can set

Code: Select all

"show_line_endings": true
in ST's (user) settings to enable on-the-fly line-ending switching.
STLineFmtToggle.png
So now you could just click the statusbar line-ending notifier, choose the Windows option, save the file and it should work in XY.
To see the attached files, you need to log into the forum.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

aliteralmind
Posts: 261
Joined: 02 Dec 2014 16:49

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by aliteralmind »

That seems to have done the trick! At least at first impression.

Thank you to all for helping me work through this.
Windows 8.1, 64-bit

admin
Site Admin
Posts: 66321
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by admin »

aliteralmind wrote:Can't XY just ignore line-ending differences? :(
It can, in the next beta version. :)

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by PeterH »

admin wrote:
aliteralmind wrote:Can't XY just ignore line-ending differences? :(
It can, in the next beta version. :)
Just a question - not that it matters for me, but to know: does that mean XY can work with files with CRLF, and with files with LF only - or it doesn't matter at all? I.e. both endings can be mixed in one file?
(Seems when changing a unix-created file with some simple windows editor, it just might add CRLFs - so the file contains mixed endings.)

admin
Site Admin
Posts: 66321
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by admin »

Hmm, mixed endings are not supported ATM. I would say such files are corrupt.

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by PeterH »

admin wrote:Hmm, mixed endings are not supported ATM. I would say such files are corrupt.
OK: no problem. Just wanted to know.
(And depends on how it's programmed. You could have interpreted LFs and ignore associated CRs: then it would be transparent. But again: not neccessary.)

aliteralmind
Posts: 261
Joined: 02 Dec 2014 16:49

Re: 2nd line in multi-line script (1st indented) "not valid"

Post by aliteralmind »

admin wrote:
aliteralmind wrote:Can't XY just ignore line-ending differences? :(
It can, in the next beta version. :)
Nice.
Windows 8.1, 64-bit

Post Reply