Textmate editor

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Textmate editor

Post by 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:

Code: Select all

#!/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
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Re: Textmate editor

Post by m i c h a e l »

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
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Textmate editor

Post by cormullion »

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/bbed ... odule.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
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Re: Textmate editor

Post by m i c h a e l »

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

Locked