Textmate editor

Started by cormullion, September 27, 2010, 10:11:37 AM

Previous topic - Next topic

cormullion

I'm having another go at using Textmate for editing newLISP. While there is much to enjoy, I'm puzzled as to why Textmate is unable to balance simple newLISP code properly. I've more than once had to test code in BBEdit to find an unbalanced p. A simple example:


#!/usr/bin/env newlisp

(set 'open-paren "(")
(set 'close-paren "(")

(define (output s)
   (println "(" s) ; a bit primitive :)
   )


Textmate can't balance any of this. I've tried both the newLISP bundles I've found on the web, but neither seem to give me the simple behaviour I'd like. Anyone got a bundle that works for this?



Colour schemes are nice, though! :)

m i c h a e l

#1
Hi cormullion!



TextMate's parenthesis balancing has always been a weak spot. Since TextMate uses regular expressions to do the parsing, it's extremely difficult to balance a set of symbols to an arbitrary nesting depth.



And I agree with you on the colo(u)r schemes! :-)



m i c h a e l

cormullion

#2
Hi michael!



Too difficult for me, perhaps, but I'm sure it's not too hard for them that can handle it.



Seth Dillingham managed it OK for newLISP (http://www.truerwords.net/articles/bbedit/codeless_language_module.html">http://www.truerwords.net/articles/bbed ... odule.html">http://www.truerwords.net/articles/bbedit/codeless_language_module.html). I'm not sure whether Textmate uses a different kind of regex syntax from the standard PCRE stuff (Onigura).



And don't most languages have lots of nested clauses and statements? I'm puzzled as to this curious lack.

m i c h a e l

#3
It looks like Seth used PCRE 5, which has "named groups," thus allowing for recursive matching. This feature does not appear to be in the regex library TextMate currently uses.



m i c h a e l