def run(self, edit):
flags = sublime.CLASS_WORD_START | sublime.CLASS_WORD_END
path = utils.get_node_content(self.view, flags)
imagepath = INFOS.addon.translate_path(path)
if not os.path.exists(imagepath):
return None
if os.path.isdir(imagepath):
self.files = []
for (_dirpath, _dirnames, filenames) in os.walk(imagepath):
self.files.extend(filenames)
break
self.files = [imagepath + s for s in self.files]
else:
self.files = [imagepath]
sublime.active_window().show_quick_panel(items=self.files,
on_select=self.on_done,
selected_index=0,
on_highlight=self.show_preview)
评论列表
文章目录