diff options
author | Kris Maglione <maglione.k@gmail.com> | 2010-12-09 22:09:05 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2010-12-09 22:09:05 -0500 |
commit | 4c9e73949c46c2e53295521d8bc23fd0c5db9282 (patch) | |
tree | a01e80cf363c4031440e011dbeb5fe4904bea1af /common/modules/template.jsm | |
parent | c5a1291eacbf11e7b93cf5bf48446e692122cf0f (diff) | |
download | pentadactyl-4c9e73949c46c2e53295521d8bc23fd0c5db9282.tar.gz |
Make more effort to get at the actual filename behind a URL in view-source and :*usage!.
Diffstat (limited to 'common/modules/template.jsm')
-rw-r--r-- | common/modules/template.jsm | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/common/modules/template.jsm b/common/modules/template.jsm index 84d7a0dc..e0f771fe 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -296,15 +296,18 @@ const Template = Module("Template", { <tr> <td style="padding-right: 20px" highlight="Usage">{ let (name = item.name || item.names[0], frame = item.definedAt) - frame ? <><span highlight="Title">{name}</span>  - <span highlight="LineInfo"> - Defined at <a xmlns:dactyl={NS} dactyl:command="buffer.viewSource" - href={frame.filename} line={frame.lineNumber} - highlight="URL">{ - frame.filename + ":" + frame.lineNumber}</a> - </span> - </> - : name + !frame ? name : /* Help... --Kris */ + let (url = frame.filename.replace(/.* -> /, "")) + <><span highlight="Title">{name}</span>  + <span highlight="LineInfo"> + Defined at <a xmlns:dactyl={NS} dactyl:command="buffer.viewSource" + href={url} line={frame.lineNumber} + highlight="URL">{ + (util.getFile(util.newURI(url)) || { path: url }).path + + ":" + frame.lineNumber + }</a> + </span> + </> }</td> <td>{item.description}</td> </tr>) |