def on_navigate(self, href):
""" open the link in a new tab on web browser """
if '$$$' in href:
try:
arr = href.split('$$$')
file_name = arr[0].strip()
location = arr[1].split(',')
row = int(location[0].strip())
col = int(location[1].strip())
sublime.active_window().open_file("%s:%s:%s" %
(file_name, row, col),
sublime.ENCODED_POSITION)
except Exception as e:
# print(e)
self.logger_msg += str(e) + '\n'
else:
try:
webbrowser.open_new_tab(href)
except Exception as e:
# logging.error('cannot open link on web browser.')
self.logger_msg += str(e) + '\n'
评论列表
文章目录