Home Download Buy Blog Forum Support

Highlight item in quick panel

Highlight item in quick panel

Postby jbjornson on Wed Feb 29, 2012 3:58 pm

Is there a way to highlight a specific entry when displaying the quick panel (without filtering the results). I would like to do something similar (visually) to what "Goto Symbol" does, which highlights the function that you are currently in. Any ideas if this is possible?
jbjornson
 
Posts: 350
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Highlight item in quick panel

Postby agibsonsw on Wed Feb 29, 2012 5:41 pm

Do you mean to highlight something "just before" the quick panel is shown?
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Highlight item in quick panel

Postby jbjornson on Thu Mar 01, 2012 8:58 am

When you invoke the "Goto Symbol" quick panel, the function that the cursor is in is highlighted/pre-selected in the list (see screenshot). I would like to pre-select an entry in the quick panel I am showing from my plugin (the first entry is always pre-selected and there seems to be no option to choose which item in the quick panel is selected).
Attachments
Quick Panel - Highlighted.png
Quick Panel - Highlighted.png (21.19 KiB) Viewed 1201 times
jbjornson
 
Posts: 350
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Highlight item in quick panel

Postby laughedelic on Tue Oct 23, 2012 9:18 pm

I do a similar thing in my plugin. So, I just add a keymap "super+r"/"ctrl+r" to replace standard with a custom command:

Code: Select all
class EasySettingsGotoSymbolCommand(sublime_plugin.TextCommand):
   def run(self, edit):
      region = <REGION OF THE FUNCTION YOU WANT TO SELECT>
      self.view.sel().clear()
      self.view.sel().add(region)
      self.view.window().run_command("show_overlay", {"overlay": "goto", "text": "@"})
laughedelic
 
Posts: 4
Joined: Thu Oct 11, 2012 7:38 pm


Return to Plugin Development

Who is online

Users browsing this forum: Google [Bot] and 4 guests