Skip to content
stadja edited this page May 10, 2012 · 4 revisions

Hello ! Thanks for your wonderful plugin, I love it.

To the question "Support for external hyperlinks would be nice. Right now they're highlighted, but you can't follow them. If there's a good, cross-platform way to open a link in the default browser that would be great"

Here is the command:

     sublime.active_window().run_command('open_url', {"url": url})

Here is the code:

    word = self.view.substr(self.view.word(location.a))
    line = self.view.substr(self.view.line(location.a))

    internalLink = "link.internal.Wiki"
    if internalLink not in self.view.scope_name(location.a):
        #try open it in a browser
        sublime.status_message("try to open " + line)
        sublime.active_window().run_command('open_url', {"url": line})
    else:
        #okay, we're good. Keep on keepin' on.word = self.view.substr(self.view.word(location.a))

that's still a good start

Clone this wiki locally