Home Download Buy Blog Forum Support

Real Time Regex Highlighting

Re: Real Time Regex Highlighting

Postby vim on Mon Oct 19, 2009 9:44 pm

AKWintermute wrote:The real gist is that I don't want to do a "search" (press or keyboard combo) each time I change the search text, I just want the selection/highlight to change as I type. If there was an event handler for the search text box similar to the on-change event handler in javascript for HTML inputs we could write a custom plug-in to handle the event. Since I'm new to Sublime I was unable to find anything in the API, perhaps one of you more familiar can point me in the right direction.


did you try ctrl+i instead of ctrl+f?
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: Real Time Regex Highlighting

Postby AKWintermute on Tue Oct 20, 2009 5:19 pm

That is pretty close to what I want thanks. Now if other all other occurrences were highlighted as well :D, just being picky. Is there a concept in sublime of a highlight vs a selection? Seems like a few of the topics talk about using highlight, but not wanting to make a selection. Seems like it would be used if it was available.
AKWintermute
 
Posts: 4
Joined: Sat Oct 17, 2009 6:31 am

Re: Real Time Regex Highlighting

Postby vim on Tue Oct 20, 2009 5:54 pm

regarding highlighting, this was much discussed and requested by us - the users, there have been some progress on latest beta, with experimental API, i have posted on another topic, but you can try this:

http://pastie.org/private/cggy1ihxlpvpwnwmv3b0qa

and add the following key binding:
Code: Select all
   <binding key="ctrl+shift+keypad_multiply" command="stickySearch set" />
   <binding key="ctrl+shift+keypad_plus" command="stickySearch add" />
   <binding key="ctrl+shift+keypad_minus" command="stickySearch clear" />


To set the highlight color, add to your theme file the following:
Code: Select all
      <dict>
         <key>name</key>
         <string>Marker</string>
         <key>scope</key>
         <string>marker</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#FFFF77</string>
         </dict>
      </dict>


it should be added inside the scope of:
Code: Select all
<dict>
   <key>name</key>
   <string>Basic</string>
   <key>settings</key>
   <array>
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: Real Time Regex Highlighting

Postby myel on Tue Oct 27, 2009 8:48 pm

this is one of the things why i have not switched from e to sublime yet...
myel
 
Posts: 88
Joined: Sat Mar 22, 2008 11:26 pm

Re: Real Time Regex Highlighting

Postby myel on Sat Nov 14, 2009 1:31 pm

this works in the latest beta. :)
myel
 
Posts: 88
Joined: Sat Mar 22, 2008 11:26 pm

Previous

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 8 guests

cron