Sublime Forum

ST3: BracketHighlighter 2

#41

@brnorman hold up your html makes no sense.

You have a div open tag outside of a form block, but it closes inside the form block. No wonder I can’t resolve it. Your tags should be nested, but yours are in nonsensical order. Please review your code again first and see if it is still not working.

0 Likes

#42

[quote=“facelessuser”]@brnorman hold up your html makes no sense.

You have a div open tag outside of a form block, but it closes inside the form block. No wonder I can’t resolve it. Your tags should be nested, but yours are in nonsensical order. Please review your code again first and see if it is still not working.[/quote]

Sorry I missed that. The page worked as expected with my misplaced tags. Moved them and now BH2 works as expected too! I guess that’s a extra debug feature.

Thanks

0 Likes

#43

Yeah, browsers are forgiving to a fault. BH can catch some bad tags, but I wouldn’t stake my life on it catching them. So usually, if BH is matching things crazy, there is something in the file throwing it off. I can’t tell you how much time I spent hammering out that algorithm, so it is pretty reliable in well formed documents.

0 Likes

#44

I can believe it and I’m sure I don’t want to know how much time you spent but I and I’m sure many many others do appreciate it! :smiley:

0 Likes

#45

HI there,
Hey bracket highlighter is really great! Thanks for putting in the work there. Just wondering though I can’t seem to get my highlights to be anything but white…

How could I mess around with that color to make it a little less harsh?
Thanks
Pete

0 Likes

#46

@pete Glad you like it.

Take a look at the readme, I talk about how you can change the colors. Also search the issues on github, I explain it multiple times there as well. If you are still having trouble after that, let me know.

0 Likes

#47

Cool thanks mate!

0 Likes

#48

New version 2.18.0 out with new experimental hover popup to show off screen bracket pair when mousing over visible bracket pair. This is experimental and depending on how it is received will determine if it sticks around.

Edit: you must be on ST3 build 3116+ and you must enable the feature in the settings file.

popup

6 Likes

#49

There was a small bug in the mdpopups dependency that would prevent the popup from opening sometimes. If you are having this issue PackageControl might not have updated your mdpopups. You can force it by running the Package Control command ‘Satisfy Dependencies’ which should pull the latest mdpopups. Restart Sublime afterwards.

0 Likes

#50

Okay, there were a couple more fixes to mdpopups related to language map handling.

The latest recommended mdpopups is 1.5.0. You can check in the console with:

>>> import mdpopups;mdpopups.version()
(1, 5, 0)

If you don’t have 1.5.0, I would run Satisfy Dependencies from the quick panel. Anyways, I think I’ve found all the critical bugs. I guess now we wait and see :).

0 Likes

#51

BracketHighlighter is missing from Package Control :(. It appears to be a Package Control issue. @wbond any idea why this suddenly occured?

0 Likes

#52

Update on the Missing Package Debacle

For those concerned about the mysterious disappearance of BracketHighlighter from Package Control, you can follow the progress of resolution here:

Basically there is nothing I can do until someone can tell me that I did something wrong recently that broke it, or the issue is resolved on Package Control. Anyone who is interested in trying the recent version, or just needs to do a fresh install will probably have to just install manually. Wbond has said he will look into to it probably tomorrow on the Package Control side.


How to install manually

  1. Download the latest tag from here: https://github.com/facelessuser/BracketHighlighter/releases.
  2. Unpack the zip into your Packages folder (renaming the folder from BracketHighlighter-st3-0.0.0 to just BracketHighlighter).
  3. Run Package Control’s Satisfy Dependencies command to get all the dependencies
  4. restart Sublime

Installing with git is also nice an option if you are comfortable with git, but you would still need to do steps 3 and 4.


It is our hopes that BracketHighlighter will be returned to us safe and sound.

0 Likes

#53

BracketHighlighter is back up. The issue was that Package Control breaks if you have too many tags. This needs to be fixed, but I was able to workaround the issue for now by deleting old tags.

2 Likes

#54

Yes, it seems we’ve discovered that at some point GitHub paginates the list of tags. There will need to be a patch in Package Control and packagecontrol.io to prevent this from happening in the future.

2 Likes

#55

Is there any way to get Bracket Highlighter to use the same colors as defined in the color scheme in the popup it shows?

I think it is currently based on individual scopes? but color schemes can define rules based on scope selectors, not just individual scopes…


Also, it would be great if we could configure how many leading and trailing lines are shown in the popup (currently 0), sometimes the bracket is on it’s own line and thus has no context, which is the main point of the popup really, to show context… (Maybe it would only be necessary to show other lines when the bracket is the only thing on the line, excluding whitespace.)


I hope it will stick around, I really like it and once it has the aforementioned improvements, I think it will be invaluable :slightly_smiling:

1 Like

#56

Is there any way to get Bracket Highlighter to use the same colors as defined in the color scheme in the popup it shows?

Mdpopup settings go in your Preferences.sublime-settings file.
http://facelessuser.github.io/sublime-markdown-popups/usage/#mdpopupsuse_sublime_highlighter

Also, it would be great if we could configure how many leading and trailing lines are shown in the popup (currently 0), sometimes the bracket is on it’s own line and thus has no context, which is the main point of the popup really, to show context…

I’ve thought about this, I need to look into an algorithm to do this and to truncate the multiple lines. I don’t want people looking at a compressed JS file and have it freeze up. This is just a concept release at this point.

(Maybe it would only be necessary to show other lines when the bracket is the only thing on the line, excluding whitespace.)

We’ll have to see.

I also have another on_hover addition coming down the pipe that might be useful as well:

unmatched popup

1 Like

#57

Thanks. Is there a reason why it doesn’t default to the ST highlighter?

good point :slight_smile: I understand it’s just a concept at the moment, I’m just providing feedback :slightly_smiling:

cool :slight_smile: what will the workflow be like when clicking the (Match brackets without threshold) link? Will it just do a one-time bracket match of the whole file to show a new popup with the link to the matched bracket, or turn off the threshold for the current view or something else? :slight_smile:

0 Likes

#58

cool :slightly_smiling: what will the workflow be like when clicking the (Match brackets without threshold) link? Will it just do a one-time bracket match of the whole file to show a new popup with the link to the matched bracket, or turn off the threshold for the current view or something else? :slightly_smiling:

One time match of whole file. I will never turn off the threshold except for one time calls. Really big files might turn unbearable if I turned it off permanently.

Thanks. Is there a reason why it doesn’t default to the ST highlighter?

I thought pygments supported more languages out of the box. My mapping for Sublime languages is still pretty basic, but maybe it handles enough of the core languages, idk.

good point :slightly_smiling: I understand it’s just a concept at the moment, I’m just providing feedback :slightly_smiling:

Yeah, I know, I was just trying to say that I’ve thought about it and just haven’t gotten to it yet. So it is something I’m going to play with.

1 Like

#59

:+1: if I understand right, a one time match of the whole file means all bracket pair positions will be known until the view is modified and thus the positions invalidated? :slightly_smiling:

Thanks for the replies.

0 Likes

#60

It means that in that instance all brackets pairs around the caret(s) will be known (up to the multi-select threshold – allowed multi-select instances), but as soon as you change your caret position, edit the doc, or re-activate the view, they disappear. It will scan the whole file to find the targeted matching pairs, but it doesn’t bother to find all matching pairs in the entire document.

The idea is that you see a invalid bracket, mouse over, click “match without threshold” and then you can mouse over it again and jump to the matching pair (or not if it was not invalid due to search threshold).

1 Like