Home Download Buy Blog Forum Support

BracketHighlighter2 BETA Branch

Re: BracketHighlighter2 BETA Branch

Postby facelessuser on Fri Mar 01, 2013 5:08 pm

Did you restart ST2 after installing? Also, please list how you installed it.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 BETA Branch

Postby simspace on Fri Mar 01, 2013 5:31 pm

facelessuser wrote:Did you restart ST2 after installing? Also, please list how you installed it.


I did restart ST2.

I already had BracketHighlighter installed and I used the info in this thread for upgrading in Package Control
http://www.sublimetext.com/forum/viewtopic.php?f=5&t=9756&start=60#p38968.

I am assuming it should work the same for select Ruby statements as is does for brace/bracket matching.

For example, when my cursor is on the inside of a "do" the matching "end" would be highlighted.
Last edited by simspace on Fri Mar 01, 2013 5:39 pm, edited 1 time in total.
simspace
 
Posts: 6
Joined: Wed Jul 11, 2012 6:44 pm

Re: BracketHighlighter2 BETA Branch

Postby facelessuser on Fri Mar 01, 2013 5:36 pm

Have you verified it actually updated? If you look in Pakckages/BracketHighlighter it should no longer have BracketHighlighter.sublime-settings, but have bh_core.sublime-settings etc.

Also, please post an example of the code it isn't working in; it is working fine for me in ST2.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 BETA Branch

Postby simspace on Fri Mar 01, 2013 5:51 pm

facelessuser wrote:Have you verified it actually updated? ...it should no longer have BracketHighlighter.sublime-settings, but have bh_core.sublime-settings etc. Also, please post an example of the code it isn't working in; it is working fine for me in ST2.


It did update. BracketHighlighter.sublime-settings is gone and I have bh_core.sublime-settings.

And I just realized what is happening. I am in my RSpec unit test code. Even though it contains valid ruby code, BracketHighlighter probably does not recognize the do/end blocks nested in the RSpec context constructs. When I go to some standard Ruby code the matching works... which ROCKS!!!

Is there a way I can add the RSpec constructs? (e.g describe/end | it/end | context/end |before/end )

In case your not familiar with RSpec... the code files end with .rb and the word "_spec" is added to the file name. So if I have a Ruby class file named "game.rb" the RSpec tests are defined in a file named "game_spec.rb."

BTW this is tutorial code, not prod code...

Code: Select all
require_relative 'movie'

describe Movie do
   before do
      @init_rank = 10
      @movie = Movie.new("goonies", @init_rank)
   end
   it "has a capitalized title" do
      @movie.title.should == "Goonies"
   end
   it "has an initial rank" do
      @movie.rank.should == @init_rank
   end

   context "created with a default rank" do
      before do
         @movie = Movie.new("goonies")   
      end
      it "has a rank of 0" do
         @movie.rank.should == 0
      end
   end

   context "with a rank of at least 10" do
     before do
         @movie = Movie.new("goonies", 10)   
     end
     it "is a hit" do
        @movie.should be_hit
     end
     it "has a 'hit' status" do
        @movie.status.should == "Hit"
     end
   end

   context "with a rank less than 10" do
     before do
         @movie = Movie.new("goonies")   
     end
     it "is a flop" do
        @movie.should_not be_hit
     end
     it "has a 'flop' status" do
        @movie.status.should == "Flop"
     end
   end

end
simspace
 
Posts: 6
Joined: Wed Jul 11, 2012 6:44 pm

Re: BracketHighlighter2 BETA Branch

Postby facelessuser on Fri Mar 01, 2013 6:01 pm

I really don't know what the difference between ruby and rspec is since I do coding in neither, but copying the code into a ruby file, it worked fine. I imagine your rspec files are not using the ruby sytanx highlighter but some other rspec syntax highlighter? If so, you need to add the appropriate syntax highlighter to your ruby config object in bh_core.sublime-settings

        // Ruby conditional statements
{
"name": "ruby",
"open": "(^\\s*\\b(?:if|case|until|unless|while|begin|class|module|def\\b\\s*[a-zA-Z_\\d]+)|do)\\b",
"close": "\\b(end)\\b",
"style": "default",
"scope_exclude": ["string", "comment"],
"plugin_library": "bh_modules.rubykeywords",
"language_filter": "whitelist",
"language_list": ["Ruby", "Ruby on Rails", "HTML (Rails)"],
"enabled": true
},
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter2 BETA Branch

Postby simspace on Fri Mar 01, 2013 6:05 pm

facelessuser wrote:...but copying the code into a ruby file, it worked fine. I imagine your rspec files are not using the ruby sytanx highlighter but some other rspec syntax highlighter? If so, you need to add the appropriate syntax highlighter to your ruby config object in bh_core.sublime-settings


Interesting... Okay I will look into that.

Thanks and great job on the plugin. You've helped make our jobs easier!

-Chris
simspace
 
Posts: 6
Joined: Wed Jul 11, 2012 6:44 pm

Re: BracketHighlighter2 BETA Branch

Postby facelessuser on Fri Mar 01, 2013 7:00 pm

No problem.

I procrastinated doing BH2 for a long time, but I am glad it is done now. It really has helped for a lot of cool added stuff.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot] and 7 guests