Home Download Buy Blog Forum Support

BracketHighlighter 2 Moar Bracket Powa!

BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Wed Oct 03, 2012 9:57 pm

Just to let users of Bracket Highlighter know, I am doing a re-write of the algorithm which is going to change a lot of things. Settings file will be different etc.

The reason is to allow more functionality. The current bracket matching algorithm has been re-written to allow for better things. In the future users will be able to define their own arbitrary "bracket" pairs. They will be able to override key points in the algorithm to assist in whatever bracket comparison or post matching stuff they are trying to do.

It will also do things like highlight a unmatched bracket in a special warning color.

An example showing special ruby highlighting and showing highlighting of unmatched bracket
BH2.png
BH2.png (29.12 KiB) Viewed 5598 times


Example configuration for ruby highlighting:
        {
"name": "ruby",
"icon": "dot",
"open": "\\b(?:if|unitl|while|def\\s*[a-zA-Z_]+)\\b",
"close": "\\bend\\b",
"sub_groups": 0,
"color": "keyword",
"style": "underline",
"scope_exclude": ["string", "comment"],
"language_filter": "whitelist",
"language_list": ["Ruby"],
// "plugin_library": "bh_user_modules.ruby.ruby",
"enabled": true
}


I will be looking for testers. If anyone is interested in doing some testing sometime in the next couple of weeks, let me know. If you have any suggestions, now would be the time to chime in.

Though testing might start in a couple of weeks, it may be a while until I finish it completely for release. We will have to see how lazy I am and how much unforeseen issues pop up.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby xeno.by on Wed Oct 03, 2012 11:22 pm

Will search_threshold be expanded? Currently I have it at 2000 and making it a 5-number figure brings noticeable slowdowns (I'm sitting at a 2.7Ghz Sandy Bridge i7, so it's not the CPU that holds highlighting back).

Quite often I need to make sense of compiler AST dumps written like Apply(Select(Ident("foo"), "bar"), List(Literal(Constant(2)))). The problem is that on dumps of non-trivial sizes, Bracket Highlighter gives up, forcing me to use paren-mode in Emacs (the only reason I'm keeping Emacs around these days). If that could be improved, it'd be lovely.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Wed Oct 03, 2012 11:37 pm

Right now I am using a threshold of 8000. I used to use a threshold of 4000.

I have a i7 3.40 GHz processor at work. At home I run the same settings on my macbook pro.

I have this ridiculous script file at work that is 55,000 lines of code. It seems fine at a threshold of 8000. I haven't pushed the limits yet. This is all early stage stuff. I haven't really compared speeds of old vs new. But I imagine it would be faster due to not having to call the ST2 API on every character like the old used to do.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Wed Oct 03, 2012 11:39 pm

Update: Just tried out 10000. Seems to work good here. Mileage may vary; I haven't tested it much outside of my own computers.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Fri Oct 05, 2012 5:42 pm

Initial tests are showing big noticeable speed improvements for BH2...and I think I can get even more speed out of it. So this is a very good thing. It seems abandoning the original algorithm was the way to go, it is just going to take a while to git this mature enough for release.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby xeno.by on Fri Oct 05, 2012 6:50 pm

facelessuser wrote:Initial tests are showing big noticeable speed improvements for BH2...and I think I can get even more speed out of it. So this is a very good thing. It seems abandoning the original algorithm was the way to go, it is just going to take a while to git this mature enough for release.

That sounds very good!

While we're at it, would it be possible for you to implement something like this, the highlighting of the stuff inside the matching parens (screenshot of parent-mode in emacs):
Attachments
paren-mode.png
paren-mode.png (11.3 KiB) Viewed 5380 times
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Fri Oct 05, 2012 7:12 pm

xeno.by wrote:While we're at it, would it be possible for you to implement something like this, the highlighting of the stuff inside the matching parens (screenshot of parent-mode in emacs):

Kind of, but not in a usable way. See this post for more info: viewtopic.php?f=3&t=5429&p=24041&hilit=brackethighlighter#p24041.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby xeno.by on Fri Oct 05, 2012 7:42 pm

Might be useful if easily togglable.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Fri Oct 05, 2012 8:56 pm

xeno.by wrote:Might be useful if easily togglable.

I don't think that would be a problem. If you could put in a feature request on github, that will help me remember to look into this. Right now I am focusing on some core stuff.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby Rezzie on Sun Oct 07, 2012 4:17 pm

facelessuser wrote:
Example configuration for ruby highlighting:
        {
"name": "ruby",
"icon": "dot",
"open": "\\b(?:if|unitl|while|def\\s*[a-zA-Z_]+)\\b",
"close": "\\bend\\b",
"sub_groups": 0,
"color": "keyword",
"style": "underline",
"scope_exclude": ["string", "comment"],
"language_filter": "whitelist",
"language_list": ["Ruby"],
// "plugin_library": "bh_user_modules.ruby.ruby",
"enabled": true
}



Where do I need to save this to enable Ruby matching?
Rezzie
 
Posts: 7
Joined: Thu Aug 18, 2011 7:42 am

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 13 guests