-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The command will read the TM_ISSUE_URL variable from the current environment so you should set this in your project’s .tm_properties file. The value should use ‘%s’ for where the issue should be inserted. E.g. for TextMate/.tm_properties we set: TM_ISSUE_URL = 'https://github.com/textmate/textmate/issues/%s'
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>beforeRunningCommand</key> | ||
<string>nop</string> | ||
<key>command</key> | ||
<string>#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -wKU | ||
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" | ||
abort "The TM_ISSUE_URL variable is unset for this project.\n\nThis needs to be set to a URL template (using %s) that translates the issue link to one that works in a browser." unless ENV.has_key? 'TM_ISSUE_URL' | ||
link = STDIN.read | ||
if link =~ %r{issue://(.+)} | ||
url = ENV['TM_ISSUE_URL'] % $1 | ||
%x{ /usr/bin/open #{e_sh url} } | ||
else | ||
abort "Not an issue link: ‘#{link}’" | ||
end | ||
</string> | ||
<key>fallbackInput</key> | ||
<string>scope</string> | ||
<key>hideFromUser</key> | ||
<string>1</string> | ||
<key>input</key> | ||
<string>selection</string> | ||
<key>inputFormat</key> | ||
<string>text</string> | ||
<key>keyEquivalent</key> | ||
<string></string> | ||
<key>name</key> | ||
<string>Open Issue Link</string> | ||
<key>outputCaret</key> | ||
<string>afterOutput</string> | ||
<key>outputFormat</key> | ||
<string>text</string> | ||
<key>outputLocation</key> | ||
<string>discard</string> | ||
<key>scope</key> | ||
<string>markup.underline.link.issue</string> | ||
<key>uuid</key> | ||
<string>D01C6CD1-A0CF-46AF-AB0E-DF8C5CAB1B36</string> | ||
<key>version</key> | ||
<integer>2</integer> | ||
</dict> | ||
</plist> |
570d257
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be nicer to use
#157
instead ofissue://157
? That would allow direct pasting to/from a comment on GitHub and it would all just work. Bonus points if you can add support for GitHub's syntax for links to issues in other repos. :-) i.e.user/Repository#123
570d257
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would clash a lot with other uses of the hash-character followed by a number.
Syntax for referring to other repositories might be useful, but personally I don’t need it — when I do, I might add it :)
570d257
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so? We're just talking about the assigned scope, right? So as long as you don't take away or override an existing scope for those strings, all the existing stuff should continue to work, would it not?
We use it quite a bit for Quicksilver (with all the plug-in repos, etc.) Seems like you would to, considering all the bundle repos. :-) In any case, one nice thing about that syntax is that you wouldn't even need to define
$TM_ISSUE_URL
to make it work. Not that I'm suggesting using that syntax all the time. I'd much rather just type/read#XXX
(or evenissue://XXX
) if that works in the current context.570d257
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for clash, I mean if you have some commented CSS with hex colors (e.g.
#000
) then that would be underlined as a clickable issue.As for
issue://XXX
that does work (i.e. w/o the brackets).570d257
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. I think the small distraction with be worth it, but OK.