def on_navigate(self, url):
if re.search('^https?://', url):
webbrowser.open_new(url)
return True
m = re.search('^(changeto|constant)\.(.*)', url)
if m:
if m.group(1) == 'changeto':
symbol, content = getSymbolDescription(self.currentSymbol, m.group(2))
else:
self.view.run_command('docphp_insert', {"string": m.group(2)})
self.view.hide_popup()
elif url == 'history.back':
symbol = self.history.pop()
self.currentSymbol = symbol
else:
self.history.append(self.currentSymbol)
symbol = url[:url.find('.html')]
self.currentSymbol = symbol
symbol, content = getSymbolDescription(symbol)
if content == False:
return False
content = self.formatPopup(content, symbol=symbol, can_back=len(self.history) > 0)
content = content[:65535]
self.view.update_popup(content)
评论列表
文章目录