Page 2 of 2
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 26 Dec 2014 15:07
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
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 26 Dec 2014 15:32
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.
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 26 Dec 2014 18:05
by bdeshi
Okay, no need to hunt down packages.
You can set
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.
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 27 Dec 2014 19:54
by aliteralmind
That seems to have done the trick! At least at first impression.
Thank you to all for helping me work through this.
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 28 Dec 2014 09:21
by admin
aliteralmind wrote:Can't XY just ignore line-ending differences?

It can, in the next beta version.

Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 28 Dec 2014 10:33
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.)
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 28 Dec 2014 10:41
by admin
Hmm, mixed endings are not supported ATM. I would say such files are corrupt.
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 28 Dec 2014 17:56
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.)
Re: 2nd line in multi-line script (1st indented) "not valid"
Posted: 29 Dec 2014 01:43
by aliteralmind
admin wrote:aliteralmind wrote:Can't XY just ignore line-ending differences?

It can, in the next beta version.

Nice.