Sublime Forum

BracketHighlighter

#181

@kmm2908, please post your settings rule and your color-scheme configured rule that goes along with it so I can understand what you are doing.

0 Likes

#182

[quote=“facelessuser”]A couple of new additions (ST3 Only):

Content Bar … [/quote]

Many thanks, facelessuser.
This is definately a useful feature!

0 Likes

#183

[quote=“jfcherng”]Many thanks, facelessuser.
This is definately a useful feature![/quote]

Your welcome :wink:.

0 Likes

#184

The custom color is working on the bracket highlight, it is just the icon in the gutter that is black and hard to see.

Settings:

“curly”: {
“icon”: “curly_bracket”,
“color”: “brackethighlighter.curly”,
“style”: “outline”
},
“round”: {
“icon”: “round_bracket”,
“color”: “brackethighlighter.round”
// “style”: “underline”
},
“square”: {
“icon”: “square_bracket”,
“color”: “brackethighlighter.square”
// “style”: “underline”
},
“angle”: {
“icon”: “angle_bracket”,
“color”: “brackethighlighter.angle”
// “style”: “underline”
},
“tag”: {
“icon”: “tag”,
// “endpoints”: true,
“color”: “brackethighlighter.tag”,
“style”: “outline”
},
“c_define”: {
“icon”: “hash”
// “color”: “brackethighlighter.c_define”,
// “style”: “underline”
},
“single_quote”: {
“icon”: “single_quote”,
“color”: “brackethighlighter.quote”
// “style”: “underline”
},
“double_quote”: {
“icon”: “double_quote”,
“color”: “brackethighlighter.quote”
// “style”: “underline”
},
“regex”: {
“icon”: “regex”,
“color”: “brackethighlighter.quote”
// “style”: “underline”
}

Color entries in theme file:

// custom colors for brackethighlighter.

name
Bracket quote
scope
brackethighlighter.quote
settings

background
#F00
foreground
#FFF



name
Bracket curly
scope
brackethighlighter.curly
settings

background
#0F0
foreground
#FFF



name
Bracket round
scope
brackethighlighter.round
settings

background
#00F
foreground
#FFF



name
Bracket square
scope
brackethighlighter.square
settings

background
#FF0
foreground
#FFF



name
Bracket angle
scope
brackethighlighter.angle
settings

background
#0FF
foreground
#FFF



name
Bracket tag
scope
brackethighlighter.tag
settings

background
#FFF

Let me know if I need to post anything else.

Thanks for quick reply.

0 Likes

#185

@kmm2908, only set the foreground color.

Sublime takes the foreground color and tints the icon. Background color should do nothing.

0 Likes

#186

[quote=“facelessuser”]@kmm2908, only set the foreground color.

Sublime takes the foreground color and tints the icon. Background color should do nothing.[/quote]

Yep that fixed it thanks!

0 Likes

#187

Hi everybody,

I am trying to modify the highlight of html tags. I would like the common tag be highlighted like that

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras congue quis augue eget blandit.

instead of

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras congue quis augue eget blandit.

I tried to change the “open” and “close” attributes of “angle” style (with copying pasting code below in “user_brackets” behavior), or change “scope_exclude” parameters, no to avail !

"user_brackets": { "name": "angle", "open": "(<)(?=^?%]|$)", "close": "(?:(?<=^?%])|(?<=^))(>)", "style": "angle", "scope_exclude": "string", "comment", "keyword.operator", "source.ruby.rails.embedded.html", "source.ruby.embedded.html"], "language_filter": "whitelist", "language_list": "HTML", "HTML 5", "XML", "PHP", "HTML (Rails)", "HTML (Jinja Templates)", "HTML (Twig)", "HTML+CFML", "ColdFusion", "ColdFusionCFC", "laravel-blade", "Handlebars", "AngularJS"], "plugin_library": "bh_modules.tags", "enabled": true } ],

Someone could help me please ?

Thanks in advance

0 Likes

#188

You can try setting endopoints to your tag style under bracket_styles:

[pre=#232628] “tag”: {
“icon”: “tag”,
“color”: “brackethighlighter.tag”,
“style”: “outline”,
“endpoints”: true
},[/pre]

This will only highlight the angled brackets of an opening and closing tag. This is a little more low profile, but currently, an option to highlight just the tag name does not exist. I don’t hard code highlights for specific rules as the core code is generic. Maybe in the future I will add a hook to allow a bh_plugin to modify the highlight region separately from the tag region.

0 Likes

#189

I am trying to reproduce the notepad++ behaviour for a upcoming theme, so your trick doesn’t help me unfortunately.
Thank you for the speed and clarity of your reply !

0 Likes

#190

I realize it’s not the same; so, if it’s “that” or nothing, then yes, you are out of luck unless I get motivated sometime soon to add such a feature.

0 Likes

#191

FYI, a critical bug that was introduced with the latest Sublime build 3067, has been patched in the latest BH. Please update to avoid having Sublime freeze up.

Also, I added a new hook that now allows for tag brackets to only highlight the tag name. There has been a number of requests for this in the past.

0 Likes

#192

So it was something wrong! Dev Build 3067

0 Likes

#193

I don’t know if the crashes were related, but Jon changed how EOF was handled in match_selectors which caused BH to go into an infinite loop when processing scope rules at the end of a file.

0 Likes

#194

FYI for BH users. A new public beta for Sublime should be coming out soon. Some recent changes had been made to Sublime on the dev releases that were incompatible with BH causing freezing or crashing. BH has since been patched, but Jon wanted to minimize bug reports when the new beta is released, so he contacted me and we worked out a way for him to exclude older BH versions that don’t have the fix.

Basically, in the 2.4.0 release I did this morning, I added a dummy file that can be checked by Sublime. When the new beta drops, all BH releases before the 2.4.0 release will not work on 3070+ builds of Sublime. My advice is to upgrade now.

Edit: Go with 2.4.1 instead. I was dumb and broke HTML tags in PHP syntax; 2.4.1 fixes that. Oh well.

0 Likes

#195

Hello! Please help me!)) Whats wrong here?
http://savepic.net/6577435m.jpg
If I open this code in NP++, I have normal highlighted bracket.

Here my code:

<div> <vb:if condition="$issue'newflag']"><a href="issue.php?{vb:raw session.sessionurl}do=gotonote&amp;issueid={vb:raw issue.issueid}&amp;goto=firstnew"><img src="{vb:stylevar imgdir_button}/firstnew.png" alt="{vb:rawphrase go_to_first_new_post}" border="0" /></a></vb:if> <a href="{vb:link issue, {vb:raw issue}}" title="{vb:raw issue.summary}" <vb:if condition="$issue'newflag']"> class="boldtext"</vb:if> id="issue_title_{vb:raw issue.issueid}">{vb:raw issue.title}</a> <vb:if condition="$issue'pagenav']"> <dl class="pagination" id="pagination_issuebit_{vb:raw issue.issueid}"> <dd> <vb:each from="issue.pagenav" value="issuepagenav"> <span><a href="{vb:link issue, {vb:raw issue}, {vb:raw issuepagenav.pageinfo}}">{vb:raw issuepagenav.curpage}</a></span> </vb:each> <vb:if condition="$show'pagenavmore']"> <span class="separator">...</span> <span><a href="{vb:raw issue.lastpagelink}">{vb:raw issue.totalpages}</a></span></vb:if> </dd> </dl> </vb:if> </div>

Thanks!

0 Likes

#196

Because you are using some non-pure HTML language. Maybe some template language I am unfamiliar with. But whatever you are using, you have tags inside of tags which breaks the tag identification.

0 Likes

#197

Yeah… But as I say above… With NP++ I do not have this problem. Perhaps you should optimize the definition of the start/end of tags and make it more a versatile, instead focus on the “non-pure HTML language” ? ))
http://savepic.net/6605086m.jpg

I love Sublime Text(and your plugin is cool too), and really want to see them even more handy! Thanks!

0 Likes

#198

So … What can I take here? As I understand, the problem appears with the tags:

<vb:if condition> <vb:each from>
(maybe somethings else?)
Is it possible to add in the plugin some custom settings, to make possible processing this tags, so that the standard tags to continue to work without this problems?
Thanks again!

0 Likes

#199

The problem isn’t the new tags, but that you are using them in the middle of the HTML opening tag.

0 Likes

#200

In general, it is not me use them so, but developers of vBulletin. So… I think that many users ST encounter this problem.
Please tell me how, in this case, to solve this problem? It is possibly?

0 Likes