Yo,
I was hacking my DarwinPorts installation earlier today and experienced something interesting. This is obviously not a DarwinPorts specific problem but here is how to reproduce it: open the '/opt/local/bin/port' file (this is a Tcl script) and then simply try to scroll down and notice how it brings TextMate to its knees.
Allan, if you don't have DarwinPorts installed, here are some more details. The 'port' command file starts with this:
#!/bin/sh #\ exec /usr/bin/tclsh "$0" "$@"
TextMate obviously picks the 'Unix shell' language module to perform the syntax coloring, based on the shebang line, and I guess that this is probably what causes the problem. I'm really not exactly sure *why* this happens with the Unix Shell bundle, I have also tried to display this Tcl script using other syntaxes, Ruby, Perl, etc, and none of them causes any problem.
So the problem is twofold: - this happens because TextMate thinks it's a shell script, which the shebang obviously points at. I wonder if TextMate could be expanded so it could "see" the exec trick to make a correct decision. - this happens because something in the Unix Shell bundle REALLY does not like what it sees in the Tcl script :)
In short, I'm not really sure where the bug is, if there is one ;)
On 4 sept. 05, at 22:06, Luc Heinrich wrote:
In short, I'm not really sure where the bug is, if there is one ;)
And by the way, this is with 1.1b17 using the latest bundles from the subversion repository...
On 04/09/2005, at 22.06, Luc Heinrich wrote:
[...] then simply try to scroll down and notice how it brings TextMate to its knees.
Allan, if you don't have DarwinPorts installed, here are some more details. The 'port' command file starts with this:
I have the file -- the problem is that the shell syntax will match { ...; } blocks (recursively), but for e.g. Tcl there's no ; in front of }, so instead it keeps nesting the groups, and that means that basically every scope in the file is unique, and the caching won't work.
Without caching, it's pretty slow to lookup styles and preferences for a scope, because of the many rules, and the non-trivial matching of scope selectors. When the system has matured, I can probably create a smart data structure for this, and stop using Cocoa as my container classes ;)