Sublime Forum

API Bug: impossible to call show_quick_panel from on_done

#1

Hi,
I get an error “Quick panel unavailable” when I try to chain quick panels. This error occurs when I call a quick panel from the on_done function of a quick panel. Below is an example. Are there any work arounds?

import sublime, sublime_plugin

class TestCommand(sublime_plugin.TextCommand):
	def run(self, edit):
		def on_done(i):
			sublime.active_window().show_quick_panel('1','2','3','4','5','6','7','8','9'], on_done)
		sublime.active_window().show_quick_panel('1','2','3','4','5','6','7','8','9'], on_done)
0 Likes

#2

Try sublime.set_timeout

0 Likes

#3

Thanks, I was just looking for this and set_timeout works like a charm for me. I created a helper method for my plugin.

def show_quick_panel(self, options, done):
        sublime.set_timeout(lambda: self.window.show_quick_panel(options, done), 10)
0 Likes