Sublime Forum

ST3: BracketHighlighter 2

#13

BracketHighlighter can now be run from a sublime-package archive. BracketHighlighter now always creates a plugin folder “Theme - BracketHighlighter” where icons will be unpacked to. If BH is not in an archive, icons are still copied to “Theme - BracketHighlighter”.

All bracket plugins should still run okay from inside the archive.

You must be on build 3013 or higher for BH to run on ST3 now.

Please report any bugs you find here.

0 Likes

#14

If you have been using ST3 with the Python3 branch of Package Control and have installed BracketHighlighter via Package Control by adding the ST3 repo for BracketHighlighter. I have resolved one more issue with Windows systems and bracket plugins not loading. BH2 should now run fine from the archive no matter what system you are using.

0 Likes

#15

I downloaded BracketHighlighter-BH2ST3.zip from github and can’t get it to work with ST3. If I put the files in SublimeText\Data\Packages\BracketHighlighter, then I get error in console:

[quote]Traceback (most recent call last):
File “D:\PortableApps\SublimeText\sublime_plugin.py”, line 147, in on_api_ready
m.plugin_loaded()
File “D:\PortableApps\SublimeText\Data\Packages\BracketHighlighter\bh_core.py”, line 1422, in plugin_loaded
init_icons()
File “D:\PortableApps\SublimeText\Data\Packages\BracketHighlighter\bh_core.py”, line 1380, in init_icons
version = sublime.load_resource(“Packages/BracketHighlighter/icons/icon_version.json”)
AttributeError: ‘module’ object has no attribute ‘load_resource’[/quote]

If I put the files in SublimeText\Data\Packages\User\BracketHighlighter, then I get no errors in the console. But then if I go to Preferences > Package Settings > Bracket Settings - Default, I get an empty file because it loads SublimeText\Data\Packages\BracketHighlighter\bh_core.sublime-settings.

So either way it is not fully working. Perhaps this is relevant: Data\Packages\User is a cryptic nested dir structure.

0 Likes

#16

You must be on build 3013 or higher for BH to run on ST3 now. Earlier versions of ST3 do not have access to load_resource API calls.

Dev build containing build 3013 is here: sublimetext.com/3dev

0 Likes

#17

Since last update (i’m not sure if it’s either the ST or BH update!) i can’t see the gutter icons anymore

Theme - BracketHighlighter directory it’s created and sublimeLinter add it’s icons in gutter

(since package control doesn’t work anymore i suspect is something wrong with latest build)

Btw, i’m not sure how this sublime package thing works. Who create the package? How? Where can I download it?

0 Likes

#18

Hang tight. Recent update broke some stuff. I should have a fix soonish.

0 Likes

#19
  • Support icons inside archive with 3014 API
  • Support changes for new add_region features
  • Add highlight styles: thin_underline, squiggly, stippled

ST3 BracketHighlighter 2 now requires 3014 to work. New highlight styles for brackets are listed above. Enjoy.

You can delete the Theme - BracketHighlighter folder now; it is no longer needed thanks to Jons new changes.

0 Likes

#20

Nothing works for me.

Installed the repository/branch for st 3 (github.com/facelessuser/Bracket … ree/BH2ST3) on my machine in the Packages folder.

It appears to be the only brackethighlighter installed (e.g., nothing from ST2 and no package).

Then, went to install it via package control, which was supposed to use the existing repository. ST3 said it was installed.

Close and restart sublime 3 (build 3017).

Nothing.

We better control of this packages thing. Every package developer can’t have their own way to install packages. That’s chaos. If we don’t get back to one way, then not many of the packages will get tested with sublime text 3 and will have few working packages by the time it ships.

0 Likes

#21

More on this failure to install the st3 branch.

My Package Control.sublime-settings is:

[code]{
“installed_packages”:

	"Package Control",
	"Theme - Soda"
],
"repositories":

	"https://github.com/facelessuser/BracketHighlighter/tree/BH2ST3"
]

}
[/code]

So, the repository would appear to be recognized.

When I go to install using package control, though, I clearly get a reference to the st2 version from github, not the local repository.

How do I install from the local repository?

0 Likes

#22

More. So, it is installed and it must be the new version.

It would appear that old style user settings no longer work. I had overridden the styles in st2 to make the bracket highlighting more visible as in:

[code]{
// Outline? (solid|outline|underline|none)
“round_style” : “solid”,
“quote_style” : “solid”,
“square_style”: “solid”,
“angle_style” : “solid”,
“tag_style” : “solid”,
“curly_style” : “solid”,

 // Scope? (Defined in theme files.)
// Examples: (keyword|string|number)
"round_scope" : "bracket",
"square_scope": "bracket",
"angle_scope" : "bracket",
"curly_scope" : "bracket",
"tag_scope"   : "bracket",
"quote_scope" : "bracket"

}
[/code]

I would just like the high visibility mode to work. How to turn it on? See reference to it in default settings, but no stub value to turn to true.

0 Likes

#23

A change in ST3 is that plugins can be run from sublime-package files rather than needing to be extracted to the packages folder. Package control also leverages this. To check, go to the “Installed Packages” directory. It is at the same level as the “Packages” folder. Any plugins should be installed there.

There is an ongoing discussion about how Package Control will support ST3 and ST2 packages. See github.com/wbond/sublime_packag … e-Packages. Probably not comprehensive, so if you see something missing, fill free to add it.

edited since you got it installed.

0 Likes

#24

The new settings file is called bh_core.sublime-settings. You can view the default by going to Preferences->Package Settings->Bracket Highlighter->Bracket Settings - Default.

Things are different now, and a little more complicated, and I apologize, but in order to bring all the flexibility people desired, things gotta change.

0 Likes

#25

Maybe it’s just that user settings don’t work.

Tried this:

[code]{
“high_visibility_style”: “solid”,

}[/code]

Note that when choosing Preferences>Package Settings>Bracket Highlighter>Bracket Settings - User, the file that opens is: bh_core.sublime-settings. Is this the right file? Seems like it is in the right place if the menu command opens it. But, it appears that the setting is ignored.

0 Likes

#26

Everything has been well tested and is working. The problem is more than likely a misunderstanding of what I am doing vs what you want to do.

“highlight_visibility_style” will only be shown when high visibility mode is activated (if you don’t know what this is, you haven’t activated it). Documentation is pretty much non-existant right now, and I keep meaning to do it.

Here is a simple example of how styling works:

Here is a bracket definition defining matching for round brackets. Notice the style is set to round:
[pre=#2D2D2D] {
“name”: “round”,
“open”: “(\()”,
“close”: “(\))”,
“style”: “round”,
“scope_exclude_exceptions”: “string.other.math.block.environment.latex”],
“scope_exclude”: “string”, “comment”],
“language_filter”: “blacklist”,
“language_list”: “Plain text”],
“find_in_sub_search”: “true”,
“ignore_string_escape”: true,
“enabled”: true
},[/pre]

Here is the style definition called round defining the specifics. Notice when attributes are missing (or commented out in this example) the default will be used:
[pre=#2D2D2D] “round”: {
“icon”: “round_bracket”
// “color”: “brackethighlighter.round”,
// “style”: “underline”
},[/pre]

Go ahead and copy the entire bh_core.sublime-settings file to your user file and edit that directly.

0 Likes

#27

Thanks. I like the new features and speed.

How do I turn on high_visibility_mode? Did text search–somehow missed it.

I’ll make the user prefs file a copy of the whole thing and start there.

0 Likes

#28

Just type “high visibility” in the command palette and you should see it. It is a toggle command; you can turn it on and off at you like.

0 Likes

#29

Hush my mouth.

What would the easiest way be to get *matched * brackets to be more visible (realize a lot of people would hate this because most of our brackets are mostly matched…). Not quite as visible as high visibility mode makes unmatched brackets–basically just solid yellow and outlined?

For , {, (, ", and '…

0 Likes

#30

High Visibility mode was never meant for full time enabled, just when you really want to see the bracket extent very clearly.

I am not entirely sure what you are looking for from your description…is the solid setting not good for you? What exactly are you looking for?

0 Likes

#31

In st2, I highlight matching braces with a light yellow background. As I cursor around I can always see what’s in scope. In st2, the default outline approach conflicts with linter and the underlines weren’t very visible.

I suppose I could get used to it because now you use a very heavy underscore.

Reason for yellow background is for seeing matching brackets with many levels of nesting on a single line (the fold column bracket chars don’t help on a single line).

so, that’s what I want. It’s ok if not possible.

0 Likes

#32

You can use any style you like. The underscore is the default style but you can change the style of any bracket you want individually.

You can use the following: solid, underline, thin_underline, outline, squiggly, stippled, or none. solid will give you the background of the bracket colored.

Do something like this to make square brackets solid. Go under the “bracket_style” setting and find the bracket you want to change and set the style to solid:
[pre=#151515] “square”: {
“icon”: “square_bracket”,
“color”: “brackethighlighter.square”,
“style”: “solid”
},[/pre]

You can do anything in BracketHighlighter 2 that you could do in BracketHighlighter 1.

0 Likes