Home Download Buy Blog Forum Support

BracketHighlighter

Re: BracketHighlighter

Postby peppy on Wed Mar 28, 2012 12:12 am

I figured that might be the case. If I get the time I might fork and give it a go to see how it handles performance-wise. I think it is be a matter of personal opinion whether such an addition makes things cluttered or more usable :).
peppy
 
Posts: 52
Joined: Thu Aug 04, 2011 4:52 pm
Location: perth, australia

Re: BracketHighlighter

Postby facelessuser on Wed Mar 28, 2012 1:08 am

peppy wrote:I figured that might be the case. If I get the time I might fork and give it a go to see how it handles performance-wise. I think it is be a matter of personal opinion whether such an addition makes things cluttered or more usable :).


Yeah, I understand. Another problem is, it won't be a simple addition. Everything is streamlined to do it the current way. Anyways, good luck.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby facelessuser on Tue Apr 03, 2012 1:05 am

Version 1.8.0
- Add new commands: "Show Bracket String Escape Mode" and "Toggle Bracket String Escape Mode". Default is "regex"

Small update to allow you to toggle the string escape mode for string brackets. There are two modes "regex" and "string":

string escape: \\{
regex escape: \{

I was kind of annoyed today when I was trying to modify some regex in a string in a JSON file, and BracketHighlighter was getting matches wrong. The current method works great when you are in something like Javascript/Perl regex etc., but not a normal string that is to be converted into regex. So now you can simply toggle to a different escape mode if you need to.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby Acciaccatura on Sun Apr 08, 2012 4:00 pm

Thanks for this great plugin, it's very useful.

I was wondering if you had any plans to add support for Ruby, particularly the matching of Ruby's method and block syntax? I noticed you mentioned you weren't a Ruby developer, so here's a quick example:

Code: Select all
def my_function(things)
  things.each do |thing|
    ...
  end
end


In this example, there would be two pairs of "braces":

1) "def" would match the final "end".
2) "do" would match the other "end".

I had a quick look at implementing this myself in the hope it was a quick change, but didn't get too far with my limited Python experience.
Acciaccatura
 
Posts: 2
Joined: Sun Apr 08, 2012 3:47 pm

Re: BracketHighlighter

Postby facelessuser on Mon Apr 09, 2012 3:59 am

Acciaccatura wrote:Thanks for this great plugin, it's very useful.

I was wondering if you had any plans to add support for Ruby, particularly the matching of Ruby's method and block syntax? I noticed you mentioned you weren't a Ruby developer, so here's a quick example:

Code: Select all
def my_function(things)
  things.each do |thing|
    ...
  end
end


In this example, there would be two pairs of "braces":

1) "def" would match the final "end".
2) "do" would match the other "end".

I had a quick look at implementing this myself in the hope it was a quick change, but didn't get too far with my limited Python experience.

The functionality you are looking for is the same as highlighting brackets, but the code to highlight these keywords like brackets don't fit in the algorithm at all.

You are not the first to ask this, and I have not yet decided if I want to pursue this yet. I will consider it, but I will not make any promises.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter

Postby Acciaccatura on Mon Apr 09, 2012 11:57 am

facelessuser wrote:The functionality you are looking for is the same as highlighting brackets, but the code to highlight these keywords like brackets don't fit in the algorithm at all.

You are not the first to ask this, and I have not yet decided if I want to pursue this yet. I will consider it, but I will not make any promises.


Thanks for replying; I figured I wouldn't be the only one interested in this feature. Fingers crossed this gets onto the roadmap :)
Acciaccatura
 
Posts: 2
Joined: Sun Apr 08, 2012 3:47 pm

Re: BracketHighlighter

Postby gregor.hoch on Sun May 27, 2012 7:39 pm

I have a (hopefully) quick question about the margin bracket symbols. I like them a lot and they look very good in Soda Theme (light grey without coloring). However, for markdown files I use MarkdownEditing and the margin brackets are colored in an ugly green. I tried to fix it by adding the code below (and more) to the .tmTheme file but it doesn't change anything. Any ideas?

Also about markdown: ` brackets are not supported, right?

Thanks for the great plugin!



https://github.com/ttscoff/MarkdownEditing

Code: Select all
<dict>
    <key>name</key>
    <string>Bracket Tag</string>
    <key>scope</key>
    <string>bracket.tag</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FD971F</string>
    </dict>
</dict>
gregor.hoch
 
Posts: 144
Joined: Sat Oct 01, 2011 7:54 pm

Re: BracketHighlighter

Postby C0D312 on Sun May 27, 2012 8:06 pm

Then you have to tell BracketHighlighter to use that scope in the user preferences. Go to Preferences > Package Settings > Bracket Highlighter > Settings - User and add the following:
Code: Select all
{
   "quote_scope" : "bracket.quote",
   "curly_scope" : "bracket.curly",
   "round_scope" : "bracket.round",
   "square_scope": "bracket.square",
   "angle_scope" : "bracket.angle",
   "tag_scope"   : "bracket.tag",
}
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: BracketHighlighter

Postby vitaLee on Sun May 27, 2012 8:45 pm

i noticed several things when i tried swap quotes plugin
quoted text at column 1 doesnt trigger bracket highlights.
that's not what initially caught my attention but i think it may be related to the next thing.
having delcaration like this
Code: Select all
a = 'bc'

when i try "swap quotes" i get
Code: Select all
a = "b"'

notice that in its initial state the line ends with the closing quote.
if you add whatever character at the end of the line, then it works as expected
Code: Select all
a = 'bc';
a = "bc";
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: BracketHighlighter

Postby facelessuser on Sun May 27, 2012 10:41 pm

vitaLee wrote:i noticed several things when i tried swap quotes plugin
quoted text at column 1 doesnt trigger bracket highlights.

Can you elaborate because I do not understand what problem you are describing.

vitaLee wrote:that's not what initially caught my attention but i think it may be related to the next thing.
having delcaration like this
Code: Select all
a = 'bc'

when i try "swap quotes" i get
Code: Select all
a = "b"'

notice that in its initial state the line ends with the closing quote.
if you add whatever character at the end of the line, then it works as expected
Code: Select all
a = 'bc';
a = "bc";

I know what this is. I will have it fixed sometime soon.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

PreviousNext

Return to Plugin Announcements

Who is online

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