Home Download Buy Blog Forum Support

BracketHighlighter

Re: BracketHighlighter

Postby snouser on Sat Feb 18, 2012 4:26 pm

Can someone explain to me how to get this plugin to work?

I've tried to add the following to my config file.

Code: Select all
   "quote_scope" : "bracket.quote",
   "curly_scope" : "bracket.curly",
   "round_scope" : "bracket.round",
   "square_scope": "bracket.square",
   "angle_scope" : "bracket.angle",
   "tag_scope"   : "bracket.tag"


Using the XML data posted a couple of posts ago.

But noting get's hilighted.

It looks like the original config (Sublime Text 2/Packages/BracketHighlighter/BracketHighlighter.sublime-settings) file isn't read at all.
I can for example add some invalid JSON/JS and it sublime won't raise an error.

I'm using build 2165.

Thanks.
snouser
 
Posts: 6
Joined: Sat Feb 18, 2012 4:20 pm

Re: BracketHighlighter

Postby facelessuser on Sat Feb 18, 2012 6:19 pm

I can confirm this works with build 2165 and everything after. I have been running this plugin on multiple platforms on every release.

When you installed the plugin, did you restart Sublime Text? This is required.

Then you have to add the XML scopes to your currently used color scheme. And it must be done properly or the color scheme will fail to load properly.

Then copy your BracketHighlighter.sublime-settings to your Packages/User folder so it will persist after updates, and then change the scopes to the exact names used in the color scheme.

I have been using this setup for a long time.
facelessuser
 
Posts: 1457
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby snouser on Sat Feb 18, 2012 11:23 pm

facelessuser wrote:[...]When you installed the plugin, did you restart Sublime Text? This is required.[...]


Ooop. I just restarted the application and everything works perfect. Thanks.

Is it possible to add the restart part to the readme?
snouser
 
Posts: 6
Joined: Sat Feb 18, 2012 4:20 pm

Re: BracketHighlighter

Postby facelessuser on Sat Feb 18, 2012 11:56 pm

Generally it is a good idea to restart after any plugin install, but I will make sure it is in the readme; it was at one point, but I might have removed it by accident.

Edit: Looks like the readme does already say you may need to restart ST2.
facelessuser
 
Posts: 1457
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby facelessuser on Sun Feb 19, 2012 11:54 pm

Version 1.1
- Add python raw string support for quote highlighting
- Add highlighting of brackets in strings; will work in all strings, but mainly meant for regex. True by default
- Add support for targetting regex strings like in javascript that are scoped as strings, but are not quoted, but use '/'s. True by default

Been really wishing I could highlight the brackets in regex strings. Now you can. Supports [],{},(); will ignore them if they are escaped. Bracket plugins currently do not target brackets inside of strings. Also added javascript style regex strings and python raw strings so you can target the brackets inside them as well.

Screen Shot 2012-02-19 at 4.52.22 PM.png
Screen Shot 2012-02-19 at 4.52.22 PM.png (21.92 KiB) Viewed 2862 times
facelessuser
 
Posts: 1457
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby facelessuser on Sun Mar 04, 2012 6:46 am

Version 1.4
- Account for perl regex, substitutions, and translations surrounded by "/" for string bracket matching
- Account for regex modifiers when matching regex surrounded by "/" in javascript and perl

Realized recently javascript regex bracket matching breaks if regex has modifiers at the end: /some_regex/gi
This should be fixed.

I also added support for perl and its match, substitution, and translation variants, and also its specific modifiers. Keep in mind this will only work if the regex is surronded by "/"s. The current syntax language for Perl doesn't handle things like this to well: s#regex#substitution#, so I am not going to even try to support such things.

Let me know if you experience issues.
facelessuser
 
Posts: 1457
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby Fed03 on Sun Mar 04, 2012 12:29 pm

awesome^
Fed03
 
Posts: 79
Joined: Sun Oct 16, 2011 6:38 pm

Re: BracketHighlighter

Postby facelessuser on Mon Mar 12, 2012 3:57 pm

So for little bit now tito has been bugging me about the way BracketHighlighter kicks off bracket matching :) . He isn't the only one; there have been a number of people that expressed they wished it did more instant highlighting. There were issues with instant highlighting which is why by default I had set a bothersome delay.

I have been thinking about overhauling the match management code to allow for more responsive highlighting, but I have been lazy and been working on other things. Well, tito opened up dialog with me and we started talking about how we each thought it should be done. After a lengthy discussion and some swapping of code, we have kind of melded are methods into what I feel is a much more responsive highlighting.

I will currently be running it all day today with the experimental branch to ensure that it behaves like I expect it to. If you want to try it out, the experimental branch is here: https://github.com/facelessuser/Bracket ... provements

Basically when highlighting will be instant in most cases (considering process time due to threshold distance). But subsequent events in close succession will be noted but not processed until things slow down a bit. We will have a background thread that will take care of this. The code also throws out redundant match requests as well to only match as many times as must be done.

I am hoping in general this will be a very responsive and good compromise between the two approaches. With this new method, you will no longer specify a delay in your settings, this will all be managed internally now. You can still set your search distance threshold. On fast computers, you may increase it, on really slow computers, you may decrease it. Obviously if you crank it up way too high, you will suffer from performance issues, but this has always and will always be the case.

Hopefully this will pacify the masses.

So as long as I see no real issues in performance (which I haven't seen yet; at least on most modern machines), this will get pushed out tonight (as long as I don't make other plans for tonight ;) )

Anyways, if you try out the experimental, let me know how you like it (good or bad).

So if you like it, you can thank tito for the push to get this done. I probably would have sat around on this for a bit longer :).
facelessuser
 
Posts: 1457
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby C0D312 on Mon Mar 12, 2012 5:15 pm

Awesome. I changed the settings a bit to my liking so that it's nearly instant. But how do I turn off the icon in the gutter? Seems like it should be simple but there is no option for "none." And commenting it out seems to break the plugin?
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: BracketHighlighter

Postby facelessuser on Mon Mar 12, 2012 5:29 pm

C0D312 wrote:Awesome. I changed the settings a bit to my liking so that it's nearly instant.

What do you mean? The experimental one should be pretty much instant now; you can't even configure the delay anymore in the experimental one; all you can do is adjust search distance. Or are you using the main branch?

C0D312 wrote:But how do I turn off the icon in the gutter? Seems like it should be simple but there is no option for "none." And commenting it out seems to break the plugin?

This will work. I will probably add an explicit "none" option in the future to be more clear.
Code: Select all
"curly_icon" : "",
facelessuser
 
Posts: 1457
Joined: Tue Apr 05, 2011 7:38 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests