Home Download Buy Blog Forum Support

ST3: BracketHighlighter 2

ST3: BracketHighlighter 2

Postby facelessuser on Sun Feb 03, 2013 4:20 pm

I now have a fully working BH2 branch for ST3

https://github.com/facelessuser/Bracket ... ree/BH2ST3

Documentation for BracketHighlighter is sparse at most. There are no keybindings, but I provide an example keybinding file to help. You can access most of the special bracket plugins without keymaps through the menu: Tools->Packages->BracketHighlighter or through the command palette. Though I recommend creating some keymaps for things you use a lot.

If you are trying to create your own custom brackets for BH2 (which is now allowed), remember that the opening and closing regex can only have ONE capturing group.

Enjoy.
Last edited by facelessuser on Tue Feb 05, 2013 4:24 am, edited 1 time in total.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3 BracketHighlighter 2

Postby Narretz on Mon Feb 04, 2013 5:36 pm

Pretty cool! Good to see the "essentials" coming to ST 3 so soon. :)
Narretz
 
Posts: 43
Joined: Mon Feb 04, 2013 5:33 pm

Re: ST3: BracketHighlighter 2

Postby shina on Fri Feb 08, 2013 7:04 pm

I just can't get this to work even on a new installation of sublime text 3.
shina
 
Posts: 6
Joined: Tue Jun 26, 2012 7:44 pm

Re: ST3: BracketHighlighter 2

Postby facelessuser on Fri Feb 08, 2013 8:04 pm

shina wrote:I just can't get this to work even on a new installation of sublime text 3.

Please answer the following questions:
Did you restart after installing? (For really complex plugins, usually a good restart is required to get the plugin going.)
How did you install it?
Where did you install it? (must be in Packages/BracketHighlighter)
What Platform are you on (Mac\Linux\Windows)?
Do you see errors in Sublime Console and can you share those if so?
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: BracketHighlighter 2

Postby shina on Sun Feb 10, 2013 1:14 pm

Sorry my mistake, when I downloaded it - it came with BracketHighlighter-BH2ST3 ... so I changed it to BracketHighlighter and it works fine.

Thanks.
shina
 
Posts: 6
Joined: Tue Jun 26, 2012 7:44 pm

Re: ST3: BracketHighlighter 2

Postby iamntz on Wed Feb 13, 2013 3:58 pm

There is a way of toggling quotes types? Like, let's say, press ctrl+shift+' and change " to ', press again change it back to " ?

Thanks!
iamntz
 
Posts: 918
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: ST3: BracketHighlighter 2

Postby facelessuser on Wed Feb 13, 2013 4:22 pm

Look under Tools->Pakckages->BracketHighlighter->Swap Quotes

Also, you can look in the Command Palette by simply typing "BracketHighlighter" to get a list of BracketHighlighter commands.

If you want a shortcut, simply look at the example shortcut file I provide, and copy the swap quotes one using the the actual key combination you would like.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: BracketHighlighter 2

Postby iamntz on Wed Feb 13, 2013 4:26 pm

In theory, what's in theory should work in practice. In practice... it doesn't. :mrgreen:

http://img.iamntz.com/jing/video_46.mp4
iamntz
 
Posts: 918
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: ST3: BracketHighlighter 2

Postby facelessuser on Wed Feb 13, 2013 4:32 pm

Well, lets peek behind the current and see whats going on.

1. BH quote swapping is scope based.
2. JSON has one valid string type, double quotes (single quotes are not valid strings in JSON; therefore, they won't be of string scope type)

BracketHighlighter's special plugins trigger off of matched brackets. Since double quotes are valid in JSON, swap quotes works just fine because BH reports the brackets. Single quotes are not valid brackets in JSON (they are not valid string tokens); therefore, BH finds no brackets to report and swap quotes never gets called.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: BracketHighlighter 2

Postby iamntz on Wed Feb 13, 2013 4:39 pm

Hmm, you are right! Thanks for explanation. I was only tried to change quotes in keymap file and... it didn't worked and i removed the key.

Tried right now on another file and works just fine.
Thanks again! :geek:
iamntz
 
Posts: 918
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests