[wingide-users] Feature request: URL recognition and linking

Wingware Support support at wingware.com
Thu Sep 29 11:47:23 EDT 2005


On Wed, 28 Sep 2005, Russell Warren wrote:
> There is probably already a feature request for this, but just in case:
> 
> It would be nice if Wing could recognize the presence of URLs inside 
> a comment (or docstring) and make them clickable, launching your 
> browser of choice at the link.  I'm not sure about the capabilities 
> of your code viewer (scintilla?), but indicating the link with an 
> underline would be nice.

It should be doable, possibly w/ some modification to the scintilla 
lexer.  I've added it as a feature request (I agree it would be very 
helpful).

Hmm, a work-around would be a script something like this (untested):

def goto_selected_url():
  editor = wingapi.gApplication.GetActiveEditor()
  doc = editor.GetDocument()
  start, end = editor.GetSelection()
  if start == end:
    return
  url = doc.GetCharRange(start, end)
  # Some checks to see if it's really a URL here
  wingapi.gApplication.OpenURL(url)

goto_selected_url.contexts = [wingapi.kContextEditor()]

This should add "Goto Selected Url" to the editor context menu and go 
to the selected url.  Of course that's not all that great because you 
really want to find the url the selection is in (not that hard w/ a 
bit of text processing) or the url you click on (but that isn't 
supported by the API now and would require diving into internals).

Still, I'm hoping the above might be helpful...

- Stephan



More information about the wingide-users mailing list