Hi,
To make it easier to visually parse blocks, I am trying to write a pattern that matches on 'even tabs' and give them a light gray background.
I tried something like
match= "^(?=\t)\t";
but that doesn't seem to work. Is look ahead not possible in pattern matches?
Gerd
On 05/09/2005, at 21.26, Gerd Knops wrote:
To make it easier to visually parse blocks, I am trying to write a pattern that matches on 'even tabs' and give them a light gray background.
I tried something like match= "^(?=\t)\t"; but that doesn't seem to work. Is look ahead not possible in pattern matches?
It is, but that pattern would match the first tab on a line.
To markup leading odd/even tabs, you could use a rule like this:
{ name = "meta.leading-tabs"; begin = "^(?=\t)"; end = "(?=[^\t])"; patterns = ( { match = "(\t)(\t)?"; captures = { 1 = { name = "meta.odd-tab"; }; 2 = { name = "meta.even-tab"; }; }; } ); },
On Mon, Sep 5, at 3:16 PM, Allan Odgaard wrote:
On 05/09/2005, at 21.26, Gerd Knops wrote:
To make it easier to visually parse blocks, I am trying to write a pattern that matches on 'even tabs' and give them a light gray background.
I tried something like match= "^(?=\t)\t"; but that doesn't seem to work. Is look ahead not possible in pattern matches?
It is, but that pattern would match the first tab on a line.
To markup leading odd/even tabs, you could use a rule like this:
{ name = "meta.leading-tabs"; begin = "^(?=\\t)"; end = "(?=[^\\t])"; patterns = ( { match = "(\\t)(\\t)?"; captures = { 1 = { name = "meta.odd-tab"; }; 2 = { name = "meta.even-tab"; }; }; } ); },
Fantastic! Works great and makes complex code much more readable. I use a 95% white background for the even tabs. It is subtle but extremely helpful. May I recommend that being added to all languages where it makes sense?
Gerd
To make it easier to visually parse blocks, I am trying to write a pattern that matches on 'even tabs' and give them a light gray background.
It's a good idea, but I think it looks butt ugly as it is now. The rows where I have no tab stops (just new line) don't colour at all, and no text on the lines with tabs colour either. I'd like the whole column as such coloured, if anything. I suppose this can't really be solved with scopes, but that's how I think it should look to be of any real help. (not dissing your idea here, as I said, it's a good one, I just comment on the current state)
Andreas
On Tue, Sep 6, at 1:56 AM, Andreas Wahlin wrote:
To make it easier to visually parse blocks, I am trying to write a pattern that matches on 'even tabs' and give them a light gray background.
It's a good idea, but I think it looks butt ugly as it is now. The rows where I have no tab stops (just new line) don't colour at all, and no text on the lines with tabs colour either.
Agreed, it isn't the most pretty. I was trying to emulate jEdit's (prettier) fold guides (see [1] for a little write-up with screen shots). What concerns me a bit is that under some conditions TextMate appears to be loosing leading tabs if that is all that exists on a row.
I'd like the whole column as such coloured, if anything. I suppose this can't really be solved with scopes, but that's how I think it should look to be of any real help. (not dissing your idea here, as I said, it's a good one, I just comment on the current state)
Personally me thinks a striped background through the whole document would really be ugly...
Gerd
Fantastic! Works great and makes complex code much more readable. I use a 95% white background for the even tabs. It is subtle but extremely helpful. May I recommend that being added to all languages where it makes sense?
As it is now, us convert-tabs-to-space types cannot use this. Not that I'm dying for it anyway, I'm all for unnesting nested code, but it's a nice idea still.
In fact, I'm a little curious to see it, could you please post a screenshot on a webserver of how it looks there for us lazy to test it on our own systems?
On Tue, Sep 6, at 2:22 AM, Caio Chassot wrote:
Fantastic! Works great and makes complex code much more readable. I use a 95% white background for the even tabs. It is subtle but extremely helpful. May I recommend that being added to all languages where it makes sense?
As it is now, us convert-tabs-to-space types cannot use this. Not that I'm dying for it anyway, I'm all for unnesting nested code, but it's a nice idea still.
In fact, I'm a little curious to see it, could you please post a screenshot on a webserver of how it looks there for us lazy to test it on our own systems?
Sure, here you go (bottom of that page):
http://www.cocoabits.com/TextMate/FoldGuides.html
Gerd
Now that looks nice, I had gotted to really like the bbedit version which were the faintly darker lines for tabs but I could live (and like this)
Thanks!