Sublime Forum

Highlight item in quick panel

#1

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?

0 Likes

How set the initial selection in a quick panel
#2

Do you mean to highlight something “just before” the quick panel is shown?

0 Likes

#3

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

0 Likes

#4

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:

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": "@"})
0 Likes