A search of the ML archives has come up empty, so I turn to the mothership: I have a problem.
Textmate is selectively refusing to open (or, rather, display) files that it should have no problem with.
Some quick and dirty testing seems to indicate that this has to do with specific file extensions. It first manifested with a problem in using the "Edit in TextMate" command, but now I fear it's more widespread than that.
First, an example to show what the behavior is like. Then, how it affects the whole system.
### Illustrative Example ###
At the moment I am writing this email in TextMate, via using the "Edit in TextMate" command.
The file:
/private/var/tmp/folders.501/TemporaryItems/Trouble with "Edit in Textmate".mail
opens just fine in TextMate. An experiment shows that I can open it fine from the Finder by dragging it onto the TM icon.
However, when I tried to write this email from gmail, and used the "Edit in TextMate" command from within Safari, it changes focus to TextMate, but no file opens.
A file has been created:
/private/var/tmp/folders.501/TemporaryItems/Loading “Gmail - Compose Mail”.safari
But textmate won't open it, not via File:Open, not via a drag to the dock, and not via Get Info association of .safari files with TextMate.
__However__. If I select _more than one_ .safari file in the Finder, and drag them to the TextMate, a very odd thing happens.
Textmate opens a new project with the three files listed. But clicking on one of those files doesn't actually open the file:

You get a blank tab. Clicking on that tab _does_ display the file:

So there's something odd going on here.
Another wrinkle is that, once you've clicked the tab and closed it once, it opens properly from the Project drawer. But not from the Finder or File:Open or the "Edit in TextMate" command.
(Yes, I am OCD about checking things like this out, why do you ask?)
I thought this was just for items in the TemporaryItems folder. But, it seems, I was wrong about that. I dragged a .safari file to the desktop and tried to open from there. No dice. Same odd multiple-item behavior.
### The Real Problem ###
The loss of "Edit in TextMate" from the browser is, for me, bad enough. I have tasted the "real text editor for the browser" crack, and I'm hooked.
But what really gets me is that this started with .php files, in Transmit. And I can't open .php files at all.
I first edited a .php file remotely in Transmit, off my SFTP server. Saved the contents, got a system beep, closed it. Totally normal, except that after that, .php files broke.
Same behavior as above: I try double-clicking a .php file in the Finder, I get TextMate open and nothing else; no document window, nothing. Multiple .php files = a new project with multiple files in the drawer. Clicking one gets a blank tab. Clicking the tab shows the file.
Now, I _can_ edit non-php files remotely in Transmit. HTML works fine. Python works fine. But no .php
Naturally, I spend most of my remote time editing .php files these days. :/
I'd prefer not to have to totally nuke TextMate, but I would really dearly love to have a functional text editor.
Thanks in advance.
Cheers,
I don't know why it wouldn't open a single file, it should open anything dragged onto it. But when your in a project situation there is a reason, it prevents opening of any extension it doesn't know about. This is incase you have large binary files you wouldn't want them taking a long time to open if you clicked them by accident. You can right click on the file (in the sidebar) and toggle the "Treat .xxx files as text/binary" option. It will remember it from then on.
I'll let someone else tackle the single file instance...
On 18/3/2006, at 20:55, Josh DiMauro wrote:
[...] You get a blank tab. Clicking on that tab _does_ display the file:
I think what happens here is that an exception is thrown somewhere in the “load/setup file” phase, which is causing the strange behavior.
If you open Console.app you will be able to see if such exception was thrown and what it is named (please quote it here).
If the problem is an exception, my guess would be that something in the preferences is corrupt, and causing it. A quick test would be to rename:
~/Library/Preferences/com.macromates.textmate.plist
If this is the problem, please send me the old file (off list, as it contains your license information) so I can further diagnose it.
On Mar 18, 2006, at 8:04 PM, Allan Odgaard wrote:
On 18/3/2006, at 20:55, Josh DiMauro wrote:
[...] You get a blank tab. Clicking on that tab _does_ display the file:
I think what happens here is that an exception is thrown somewhere in the “load/setup file” phase, which is causing the strange behavior.
If you open Console.app you will be able to see if such exception was thrown and what it is named (please quote it here).
Yup. When opening a *.php file or trying to edit from Safari, I get:
2006-03-18 20:42:08.382 TextMate[14497] *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value
If the problem is an exception, my guess would be that something in the preferences is corrupt, and causing it. A quick test would be to rename:
~/Library/Preferences/com.macromates.textmate.plist
Renaming the pref file does fix the problem. Of course, there's redoing my prefs... oh, well. :)
If this is the problem, please send me the old file (off list, as it contains your license information) so I can further diagnose it.
Sent. Thanks. :)
On Mar 18, 2006, at 8:55 PM, Josh DiMauro wrote:
On Mar 18, 2006, at 8:04 PM, Allan Odgaard wrote:
On 18/3/2006, at 20:55, Josh DiMauro wrote:
[...] You get a blank tab. Clicking on that tab _does_ display the file:
I think what happens here is that an exception is thrown somewhere in the “load/setup file” phase, which is causing the strange behavior.
If you open Console.app you will be able to see if such exception was thrown and what it is named (please quote it here).
Yup. When opening a *.php file or trying to edit from Safari, I get:
2006-03-18 20:42:08.382 TextMate[14497] *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value
Okay, so far I've managed to duplicate the breaking of PHP files a second time, but not reliably.
So far as I can tell, the trigger is "Edit with Textmate" from an FTP server in Transmit, but what conditions specifically cause it to break, I'm uncertain.
Once I've gotten it to break, it always throws an exception when opening a .php file.
Replacing the preferences with a clean backup file always fixes the problem.
It's the breaking that seems to be a hit-or-miss affair. Which makes sense, because it would have been fixed by now if it were common. :)
In any case, TextMate is running and I've got a backup prefs file for fixing it in the future.
Cheers,