def on_load_async(self, view):
if view and view.file_name() and not view.settings().get('open_with_edit'):
item = SideBarItem(os.path.join(sublime.packages_path(), 'User', 'SideBarEnhancements', 'Open With', 'Side Bar.sublime-menu'), False)
if item.exists():
settings = sublime.decode_value(item.contentUTF8())
selection = SideBarSelection([view.file_name()])
for item in settings[0]['children']:
try:
if item['open_automatically'] and selection.hasFilesWithExtension(item['args']['extensions']):
SideBarFilesOpenWithCommand(sublime_plugin.WindowCommand).run([view.file_name()], item['args']['application'], item['args']['extensions'])
view.window().run_command('close')
break
except:
pass
评论列表
文章目录