Sublime Forum

BracketHighlighter

#41

This should work for the tiny text people :smile: .


Should have it out soon.

0 Likes

#42

Version 1.5.2

  • Use tiny icons when line height is less than 16
  • Use no icon if icon cannot be found
  • Optimize png icons

That took longer than I would have liked.

0 Likes

#43

how do you get your highlights/icons coloured in different colors?

0 Likes

#44

You can look at the readme.md file on the github repository. There is a section on changing colors. Let me know if you have more questions.

Readme
github.com/facelessuser/Bracket ā€¦ /readme.md

0 Likes

#45

damn!!! where was i looking? i think i checked the readme in package directory. Doā€™h!

0 Likes

#46

The readme in the package is the readme on the repository. The package one comes from the repository :smile:.

0 Likes

#47

Thanks for the small icons! :smile:

A very super stylish comment, feel free to ignore me. :smiley:

I added a little bit of padding and made very tiny corrections to the small icons.
Found these in the following link ( Iā€™m not going to send a pull request )
dl.dropbox.com/u/9303546/Sublime ā€¦ _icons.zip

Default looks like this:

I made this:

Regards,

0 Likes

#48

+1 for the padding. i noticed it too.

0 Likes

#49

[quote=ā€œtitoā€]Thanks for the small icons! :smile:

A very super stylish comment, feel free to ignore me. :smiley:

I added a little bit of padding and made very tiny corrections to the small icons.
Found these in the following link ( Iā€™m not going to send a pull request )
dl.dropbox.com/u/9303546/Sublime ā€¦ _icons.zip

Default looks like this:

I made this:

Regards,[/quote]

Thanks! I did not fool around with padding. I only made sure they worked. A very nice improvement. I will try and get these in tonight.

I know there is a slight padding issue with the angle_bracket.png (large version) and I will try and align it better too.

0 Likes

#50

titoā€™s tiny icons are now in.

Also fixed the big angle bracket iconā€™s alignment.

I think this completes the great icon experiment.

I have to say, I wasnā€™t sure how it would go over, but it seems people generally like them. Thanks for the feedback and contributions. I think it all looks pretty polished now.

0 Likes

#51

I like the new icons but have a big problem with them. Initially, they display correctly but after just a short moment they change to complete garbage. I have attached screenshots.

I am using Mac OS, ST2 2183, and Soda Theme.

Any ideas?

Thanks!



0 Likes

#52

Interesting, does it say something in the console? Like canā€™t find some_icon.png?

I am on Mac OSX myself and use Windows 7 at work, and I have not seen this. After installation of the plugin, you need to restart ST2; you get glitches like this until you do. Does a restart of ST2 help you?

I will also try enabling Soda Theme and see if that somehow interferes.

You might possibly get this issue when Package Control upgrades the plugin as well, again a restart should help.

Edit:
Soda Theme does not interfere for me. A restart is all you probably need.

0 Likes

#53

[quote=ā€œgregor.hochā€]I like the new icons but have a big problem with them. Initially, they display correctly but after just a short moment they change to complete garbage. I have attached screenshots.

I am using Mac OS, ST2 2183, and Soda Theme.

Any ideas?

Thanks![/quote]

This was happening to me, and was fixed after restarting Sublime ā€“ have you restarted?

0 Likes

#54

yes, a restart solved the problem. Thanks!

0 Likes

#55

Version 1.5.3

  • Allow turning off gutter icons for multi-select via settings
  • Fix multi-select detection
  • Default the internal settings if setting is not found

Someone had mentioned that sometimes the gutter icons can get a bit too much, so I have added a setting to disable gutter icons during multi-select.

The default is to allow gutter icons in multi-select

// Disable gutter icons when doing multi-select "no_multi_select_icons": false,

0 Likes

#56

I still want to do some more playing around with the icons. For now, hereā€™s an HTML ā€˜tagā€™ icon: cl.ly/2M1x0e2g141X1Y1I1B3z

Might want to change it later, but thatā€™s it so far.

0 Likes

#57

[quote=ā€œC0D312ā€]I still want to do some more playing around with the icons. For now, hereā€™s an HTML ā€˜tagā€™ icon: cl.ly/2M1x0e2g141X1Y1I1B3z

Might want to change it later, but thatā€™s it so far.[/quote]

Just tried it out; I like it. Keep it up :smile:.

0 Likes

#58

Someone thanks you :wink:

0 Likes

#59

@facelessuser,

Hey, thanks for BracketHighlighter. I didnā€™t know I needed it until I used it. Very helpful indeed.

Just one thing, though. Is it possible to not select the bracket/quote if the cursor is outside of it? For example, if I have the string:

ā€œThis is a stringā€

The quotes get highlighted when the cursor is outside of them. Iā€™d like to highlight them only if the cursor is on the inside. I looked through the settings but didnā€™t see anything that seemed like it was related. I am not unwilling (there I go using a double negative!) to dig into the code and try to figure it out, but I know that these sorts of things can be quite complicated, especially if heavily dependent on regular expressions. Iā€™m hoping you can very quickly say yea or nay and not have to spend much time at all digging into it.

Thanks again.

EDIT: Actually, I should be a bit more specific regarding what Iā€™d like to see when the cursor is outside. If the bracket/quotes are nested, the surrounding bracket/quotes should be highlighted when the cursor is outside the quotes in question. For instance:

function say_hi()
{
    alert('Hi there');
}

In this example, I would expect the single quotes to be highlighted whenever the cursor is between them, but as soon as the cursor is outside of the single quotes (even immediately adjacent, but still outside), the parens of alert should be highlighted. As soon as the cursor is outside of the parens, the curly braces should highlight. As it is right now, you have to be at least one character away from a bracket/quote before it will not be highlighted and the surrounding bracket/quote highlighted.

I hope that makes sense. It is sometimes difficult to express in words something that is inherently visual.

0 Likes

#60

Current highlighting favors what ever is to the left of it. ST2s built in bracket underlining is very similar, but actually less consistant which makes brackets not get underlined in certain scenarios.

I chose a very consistant and predictable way to highlight. I think this better illustrates what I am doing:

With that said, I can add the logic in, but you may have to wait a little. I have been doing quite a bit of plugin coding recently and I think I need a little break :smile:.

The code is not done with regexā€¦I think regex is the wrong tool for the job here (not to say it possibly canā€™t be done with regex). I understand thought that not being done with regex doesnā€™t always make the code easier to follow. If you really want to tinker with it and get this functionality before I get to it, you would probably look in adjacent_adjust, string_adjacent_adjust, and the very beginning of I think match_quotes. The first I believe handles brackets intial highlighting, the second handles brackets inside strings initial highlighting, and the third handles quote initial highlighting in the beginning.

If you get it working and would like to do a pull request the main things that I require is that it is optional, and you donā€™t break existing logic or functionality (the old method needs to work the same; it took me a little to iron logic out), and brakcets must be highlighted in some scenario no matter which direction the cursor comes from (cursor moving from left and cursor moving form right, the brackets need to fall into a scenario where they will always get highlighted.

That is it. If it is something you donā€™t want to mess with, I will try and get to it sometime soon, just create an issue in github so I donā€™t forget.

0 Likes