summaryrefslogtreecommitdiff
path: root/common/modules/template.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2010-12-09 22:09:05 -0500
committerKris Maglione <maglione.k@gmail.com>2010-12-09 22:09:05 -0500
commit4c9e73949c46c2e53295521d8bc23fd0c5db9282 (patch)
treea01e80cf363c4031440e011dbeb5fe4904bea1af /common/modules/template.jsm
parentc5a1291eacbf11e7b93cf5bf48446e692122cf0f (diff)
downloadpentadactyl-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.jsm21
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>&#xa0;
- <span highlight="LineInfo">
- Defined at&#xa0;<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>&#xa0;
+ <span highlight="LineInfo">
+ Defined at&#xa0;<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>)