[TxMt] Interesting text coloring (massive) slowdown
Luc Heinrich
lucsky at mac.com
Sun Sep 4 20:06:41 UTC 2005
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 ;)
--
Luc Heinrich - lucsky at mac.com - http://www.honk-honk.com
More information about the textmate
mailing list