Home Download Buy Blog Forum Support

BracketHighlighter2 BETA Branch

Re: BracketHighlighter2 Alpha Branch

Postby facelessuser on Tue Oct 23, 2012 7:10 pm

I will make the ruby post_match plugin official. If this works good for you.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 Alpha Branch

Postby vitaLee on Tue Oct 23, 2012 7:40 pm

Man, you're tireless. :D
It's working.
Im sure there'll be other exotic problems to solve with ruby being expressive as it's, but you clearly prooved the flexibility of BH2.
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: BracketHighlighter2 Alpha Branch

Postby vitaLee on Tue Oct 23, 2012 7:49 pm

you might want to update open pattern to
"open": "(^\\s*\\b(?:if|until|unless|while|begin|class|module|def\\b\\s*[a-zA-Z_]+)|do)\\b"

to account for this side effect
Screen shot 2012-10-23 at 22.42.21.png
Screen shot 2012-10-23 at 22.42.21.png (12.66 KiB) Viewed 1393 times


Also i vote 1+ for styles extracted and reused across definitions.
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: BracketHighlighter2 Alpha Branch

Postby facelessuser on Tue Oct 23, 2012 8:14 pm

vitaLee wrote:you might want to update open pattern to
"open": "(^\\s*\\b(?:if|until|unless|while|begin|class|module|def\\b\\s*[a-zA-Z_]+)|do)\\b"

to account for this side effect
Screen shot 2012-10-23 at 22.42.21.png


Great! Thanks for your help on this. I haven't coded in ruby so it is nice to have help nailing it down.

vitaLee wrote:Also i vote 1+ for styles extracted and reused across definitions.

That is the good thing about this being an alpha; in an alpha I can change everything and say "I told it you it was an alpha". Beta I don't have that much flexibility. I am thinking it would make more sense with separate style objects. I will have to see how much I have to change in the algorithm to make that happen. I will see if anyone else chimes in as well.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 Alpha Branch

Postby facelessuser on Wed Oct 24, 2012 5:22 am

Ruby fixes are in.

Still tinkering with the styles. Separating the styles doesn't really reduce the number of style stuff by much, it just puts it in a separate place. The regions are made up of the whole combination of icon, color, and highlight style, so they really need to be one package. So even if you use the same color and highlight style, having different icons still means having separate style objects. And I really don't think I am looking for an overly complicated styling system either. I will play with it in the next couple of days, and hopefully role something out. I think the separation is good, I just don't think its going to amount to great reduction of stuff in the config file.

That is how it goes though; you want something highly configurable, sometimes the downside is you have to configure that stuff every time.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 Alpha Branch

Postby iamntz on Wed Oct 24, 2012 2:25 pm

I either found a small bug or i don't get it right.
So, in my bh_wrapping file (inside user folder) i added this:

Code: Select all
        {
            "enabled": true, "language_list": ["HTML", "HTML 5", "XML", "PHP", "ColdFusion", "ColdFusionCFC"], "language_filter": "whitelist", "entries": [
                {"name": "HTML/XML Tag", "brackets": ["<${BH_SEL:NAME}>", "</${BH_SEL:NAME}>"]},
                {"name": "HTML/XML Tag - Block", "brackets": ["<${BH_SEL:NAME}>", "</${BH_SEL:NAME}>"], "insert_style": "block"},
                {"name": "HTML/XML Tag - Block Indent", "brackets": ["<${BH_SEL:NAME}>", "</${BH_SEL:NAME}>"], "insert_style": "indent_block"},
                {"name": "PHP Tags", "brackets": ["<?php${BH_SEL}", "?>"], "insert_style": "indent_block"},
                {"name": "PHP Tags", "brackets": ["<?php${BH_SEL}", "?>"], "insert_style": "block"}
            ]
        },


What i would like is to highlight pairs of <?php ?> tags. What do i do wrong?

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

Re: BracketHighlighter2 Alpha Branch

Postby vitaLee on Wed Oct 24, 2012 3:01 pm

bracket pair definitions are within bh_core.sublime-settings.
i imagine there'll be conflicts with already defined pairs containing angle brackets though.
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: BracketHighlighter2 Alpha Branch

Postby facelessuser on Wed Oct 24, 2012 3:08 pm

Nah, you should be able to define php no problem. I will post in a bit (if the forum lets me; I think it is breaking down again).
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 Alpha Branch

Postby facelessuser on Wed Oct 24, 2012 3:14 pm

Just paste the php define before tags. Order counts in the settings file.

        // PHP enclosure
{
"name": "php_enclosure",
"open": "(<\\?php)",
"close": "(\\?>)",
"icon": "angle",
"color": "brackethighlighter.angle",
"style": "underline",
"language_filter": "whitelist",
"scope_exclude": ["string", "comment", "keyword.operator"],
"language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML+CFML", "ColdFusion", "ColdFusionCFC"],
"enabled": true
},
// HTML Tags
{
"name": "tag",
"open": "(<)",
"close": "(>)",
"icon": "tag",
"color": "brackethighlighter.tag",
"style": "outline",
"language_filter": "whitelist",
"scope_exclude": ["string", "comment", "keyword.operator"],
"language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML+CFML", "ColdFusion", "ColdFusionCFC"],
"plugin_library": "bh_modules.tags",
"enabled": true
},
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 Alpha Branch

Postby vitaLee on Wed Oct 24, 2012 3:18 pm

@facelessuser is that a custom color scheme you're using?
care to share?
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: mlf and 5 guests