[TxMt] Re: Question about indentation

Allan Odgaard mailinglist at textmate.org
Mon Apr 22 05:21:45 UTC 2013


On Apr 22, 2013, at 3:21, Peter Rando <peter.rando at yahoo.com> wrote:

> I've used Whitesmith bracing style for *decades*, and had it kinda-sorta working in TM 1.5.x, though not perfectly.  Now I've lost those old settings and for the life of me can't figure out how to get it even close in 2.0 […]

This style can’t be expressed with the current classification patterns.

The best approximation is probably to remove { and } from the default patterns.

> Also, just as a general suggestion, it seems like it would be really helpful to have just a handful of "packaged" example indentation rules for the small handful of  common bracing styles, i.e. Allman, K&R, Whitesmith, maybe Gnu.

The default pattenrs are compatible with both Allman and K&R. Neither Whitesmith nor Gnu can really be expressed ATM.

I’ve been considering ways to improve the indentation system, an obvious improvement would be to drop the somewhat arcanely named classification patterns and instead use a register based system where a match can add/subtract to a register, where a register represents the indent of the current line, future lines, or a “carry register”.

However, the biggest problem with the indent system is hard-wrapped lines and lisp-like languages, so while the above might be a nice improvement, it’s not really solving the real issue.



More information about the textmate mailing list