def on_select(self, index: int, transient: bool=False) -> None:
"""Called when an option is been made in the quick panel
"""
if index == -1:
self._restore_view()
return
cluster = self.last_cluster
node = cluster[index]
if transient and 'options' in node:
return
if 'options' in node:
self.prev_cluster = self.last_cluster
opts = node['options'][:]
opts.insert(0, {'title': '<- Go Back', 'position': 'back'})
sublime.set_timeout(lambda: self.show(opts), 0)
else:
if node['position'] == 'back' and not transient:
sublime.set_timeout(lambda: self.show(self.prev_cluster), 0)
elif node['position'] != 'back':
Jumper(self.view, node['position']).jump(transient)
评论列表
文章目录