I have a plugin where I initialize a quick panel with perhaps a few hundred options. The quick panel loads instantly, but upon making a selection, there is a 1-2 second lag. I’m curious why that might be and what I can do about it. I would have expected the loading to take time, but the selection to be instant because theres no iteration going on. Posting the code below.
class CanopyCategorySelectCommand(sublime_plugin.TextCommand):
def run(self, edit):
selected_index = CanopyParseData.categories_by_index[CanopyInterfaceManager.get_cursor_position()
]['index']
CanopyInterfaceManager.create_quick_panel(
self.generate_display_list(CanopyParseData.categories),
self.on_done,
selected_index=selected_index
)
def on_done(self, selection_index):
if selection_index > -1:
category = CanopyParseData.categories[selection_index]
CanopyInterfaceManager.set_cursor_position(category['start'])
def generate_display_list(self, categories):
return [category['name'] for category in categories]