Skip to content

Commit

Permalink
Merge pull request #32 from liuhewei/master
Browse files Browse the repository at this point in the history
add an item for copyonly - only copy url
  • Loading branch information
ehamiter committed Oct 27, 2014
2 parents d767239 + c36571c commit ba54a28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Context.sublime-menu
@@ -1,5 +1,6 @@
[
{ "command": "githubinator", "caption": "GitHubinator", "args": { "permalink": false } },
{ "command": "githubinator", "caption": "Copy GitHubinator...", "args": { "permalink": false, "copyonly": true } },
{ "command": "githubinator", "caption": "GitHubinator on Master", "args": { "permalink": false, "branch": "master" } },
{ "command": "githubinator", "caption": "GitHubinator Permalink", "args": { "permalink": true } },
{ "command": "githubinator", "caption": "GitHubinator Blame", "args": { "permalink": false, "mode": "blame" } },
Expand Down
5 changes: 5 additions & 0 deletions Default.sublime-commands
Expand Up @@ -4,6 +4,11 @@
"command": "githubinator",
"args": { "permalink": false }
},
{
"caption": "Copy GitHubinator...",
"command": "githubinator",
"args": { "copyonly": true }
},
{
"caption": "GitHubinator on Master",
"command": "githubinator",
Expand Down
5 changes: 3 additions & 2 deletions githubinator.py
Expand Up @@ -20,7 +20,7 @@ def load_config(self):
DEFAULT_GITHUB_HOST = "github.com"


def run(self, edit, permalink = False, mode = 'blob', branch = None):
def run(self, edit, copyonly = False, permalink = False, mode = 'blob', branch = None):
self.load_config()
if not self.view.file_name():
return
Expand Down Expand Up @@ -76,7 +76,8 @@ def run(self, edit, permalink = False, mode = 'blob', branch = None):
sublime.set_clipboard(full_link)
sublime.status_message('Copied %s to clipboard.' % full_link)
print('Copied %s to clipboard.' % full_link)
self.view.window().run_command('open_url', {"url": full_link})
if not copyonly:
self.view.window().run_command('open_url', {"url": full_link})
break


Expand Down

0 comments on commit ba54a28

Please sign in to comment.