Extends the SLT's default pop-up for adding our content without override by a new one.
Go to Sublime Text X\Data\Packages\User\
git submodule add --force https://github.com/vic4key/sublime_text_popup_extended.git
Create a SLT plugin and use the following sample codes
from .sublime_text_popup_extended import *
def my_popup_content(view, point) -> list:
result = []
word = view.substr(view.word(point))
result.append("You are hover on '%s'" % word)
result.append("<a href=\"http://www.google.com/search?q=%s\">Search on Google for '%s'</a>" % (word, word))
return result
def my_on_navigate(href) -> None:
print("href = '%s'" % href)
def plugin_loaded():
sublime_text_popup_extended.setup(
heading_text="My Content",
fn_popup_content=my_popup_content,
fn_on_navigate=my_on_navigate)