mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-27 14:05:45 +01:00
Make more effort to get at the actual filename behind a URL in view-source and :*usage!.
This commit is contained in:
@@ -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>)
|
||||
|
||||
Reference in New Issue
Block a user