Are there any plans for, or any interest in, making it easier to see and set the newline style of open files? Right now it seems you can control this only through the Preferences dialog, and there's no at-a-glance way to tell (or change) what newline style an open file is actually using.
The absence of this bit me last night, when I made changes to someone's PHP file that had been saved with Mac newlines. I had added some HEREDOC-quoted text, and the script started throwing parsing errors which completely stumped me until I opened the file in Some Other Text Editor and saw that it was using Mac newlines.
A newline type selector/indicator in the bottom bar is the most obvious thing to do (it might even be combined with the spaces/tabs popup), but I'm sure there are other ways to do it as well.
Possible?
thanks
pb
-- Paul Bissex http://e-scribe.com/news/ Northampton MA USA 01061-0847
On 6/12/2005, at 14:17, Paul Bissex wrote:
Are there any plans for, or any interest in, making it easier to see and set the newline style of open files? Right now it seems you can control this only through the Preferences dialog
Or using Save As…
and there's no at-a-glance way to tell (or change) what newline style an open file is actually using.
I think the situation where you need this info is too rare to spend valuable status bar space on it and the status bar already seems to have reached its threshold wrt shown info (yes, I know, it can be configurable…).
There should be a more detailed “Information” panel in the future that one can bring up for a file.
[...] A newline type selector/indicator in the bottom bar is the most obvious thing to do (it might even be combined with the spaces/ tabs popup), but I'm sure there are other ways to do it as well.
I assume that the problem in your case was, that TextMate actually preserved the CR when you wanted to have the file “upgraded” to LF?
IMO LF is (now) the proper way to newline terminate files, and the other methods are supported only for legacy files -- to have TM automatically upgrade your files, check the “Use for existing files as well” below the option in Preferences, then TM will silently upgrade your files, and you don't have to worry about this. Currently though, newline termination is coupled with encoding (so it'd also “upgrade” the encoding, if the file use some legacy 8 bit encoding ;) ).
On 12/7/05, Allan Odgaard throw-away-1@macromates.com wrote:
On 6/12/2005, at 14:17, Paul Bissex wrote:
Are there any plans for, or any interest in, making it easier to see and set the newline style of open files? Right now it seems you can control this only through the Preferences dialog
Or using Save As…
Point taken. However, I meant specifically changing the file in place. One can't easily use Save As while editing a file via ODB, which I do a lot. My work style may be unusual, making this more of a problem for me than for others.
and there's no at-a-glance way to tell (or change) what newline style an open file is actually using.
I think the situation where you need this info is too rare to spend valuable status bar space on it and the status bar already seems to have reached its threshold wrt shown info (yes, I know, it can be configurable…).
Fair enough.
There should be a more detailed "Information" panel in the future that one can bring up for a file.
That would be good. As I'm sure you know, (I was trying to write this without referring to anybody else's products!) BBEdit, TextWrangler, and other Mac text editors make this info available (and usually changeable in the same location, which is nice.)
[...] A newline type selector/indicator in the bottom bar is the most obvious thing to do (it might even be combined with the spaces/ tabs popup), but I'm sure there are other ways to do it as well.
I assume that the problem in your case was, that TextMate actually preserved the CR when you wanted to have the file "upgraded" to LF?
Sort of. Silent "upgrade" would have avoided the problem but it's also useful to know what's there in the original -- if I'm working with somebody who keeps uploading CR-terminated files, for example, I'd like to know so I can educate them.
And in general I think it's important that a text editor by default makes no silent changes. Though I have to admit I can't think of a case when changing a file from CR to LF would break something.
Thanks for the detailed response.
pb
-- Paul Bissex http://e-scribe.com/news/ Northampton MA USA 01061-0847
On 7/12/2005, at 14:54, Paul Bissex wrote:
Or using Save As…
Point taken. However, I meant specifically changing the file in place. One can't easily use Save As while editing a file via ODB, which I do a lot [...]
Just for the records: you can use Save As with ODB just fine.
On 12/8/05, Allan Odgaard throw-away-1@macromates.com wrote:
On 7/12/2005, at 14:54, Paul Bissex wrote:
Or using Save As…
Point taken. However, I meant specifically changing the file in place. One can't easily use Save As while editing a file via ODB, which I do a lot [...]
Just for the records: you can use Save As with ODB just fine.
I should have been more specific -- I meant when editing a file stored on an FTP/SFTP server.
In other words, you can't do the following on a selective, per-file basis (you can do it globally with the "use for existing files as well" pref checked):
1) Open a file via ODB (e.g. from Cyberduck) 2) Change the file's newlines from CR to LF 3) Save the revised file, overwriting the original
Right?
I'm not trying to be a pain. If I'm the only person in the world who wants this BBEdit/TextWrangler style feature then I'll fold. I actually thought it would turn out to be a common-ish request.
pb
-- Paul Bissex http://e-scribe.com/news/ Northampton MA USA 01061-0847
On 8/12/2005, at 22:32, Paul Bissex wrote:
Just for the records: you can use Save As with ODB just fine.
[...] you can't do the following on a selective, per-file basis [...]
- Open a file via ODB (e.g. from Cyberduck)
- Change the file's newlines from CR to LF
- Save the revised file, overwriting the original
Right?
Sure you can. Open file (from FTP client), shift-cmd S, switch to CR and save. Watch file be uploaded with CR.