Home Download Buy Blog Forum Support

BracketHighlighter

Re: BracketHighlighter

Postby gregor.hoch on Thu Mar 15, 2012 1:24 pm

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!
Attachments
icon-garbage.png
icon-garbage.png (6.96 KiB) Viewed 1481 times
icon-correct.png
icon-correct.png (7.06 KiB) Viewed 1482 times
gregor.hoch
 
Posts: 128
Joined: Sat Oct 01, 2011 7:54 pm

Re: BracketHighlighter

Postby facelessuser on Thu Mar 15, 2012 1:37 pm

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.
Last edited by facelessuser on Thu Mar 15, 2012 1:55 pm, edited 1 time in total.
facelessuser
 
Posts: 1446
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby dribble on Thu Mar 15, 2012 1:49 pm

gregor.hoch wrote: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!


This was happening to me, and was fixed after restarting Sublime -- have you restarted?
dribble
 
Posts: 6
Joined: Sun Mar 04, 2012 9:35 pm

Re: BracketHighlighter

Postby gregor.hoch on Thu Mar 15, 2012 2:02 pm

yes, a restart solved the problem. Thanks!
gregor.hoch
 
Posts: 128
Joined: Sat Oct 01, 2011 7:54 pm

Re: BracketHighlighter

Postby facelessuser on Thu Mar 15, 2012 11:06 pm

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
Code: Select all
    // Disable gutter icons when doing multi-select
    "no_multi_select_icons": false,
facelessuser
 
Posts: 1446
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby C0D312 on Fri Mar 16, 2012 2:38 am

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

Might want to change it later, but that's it so far.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: BracketHighlighter

Postby facelessuser on Fri Mar 16, 2012 3:19 am

C0D312 wrote:I still want to do some more playing around with the icons. For now, here's an HTML 'tag' icon: http://cl.ly/2M1x0e2g141X1Y1I1B3z

Might want to change it later, but that's it so far.


Just tried it out; I like it. Keep it up :).
facelessuser
 
Posts: 1446
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby bizoo on Fri Mar 16, 2012 9:09 am

facelessuser wrote: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.

Someone thanks you ;)
bizoo
 
Posts: 859
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: BracketHighlighter

Postby phillip.koebbe on Fri Mar 16, 2012 12:56 pm

@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:

Code: Select all
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.
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: BracketHighlighter

Postby facelessuser on Fri Mar 16, 2012 2:15 pm

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:
Screen Shot 2012-03-16 at 7.55.21 AM.png
Screen Shot 2012-03-16 at 7.55.21 AM.png (12.54 KiB) Viewed 1368 times


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 :).

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.
facelessuser
 
Posts: 1446
Joined: Tue Apr 05, 2011 7:38 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests