Skip to content

Commit db61ee2

Browse files
committed
Fix open link from editor
1 parent badd8c4 commit db61ee2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/extension.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ function getGitHubLinkForRepo(cb) {
104104
getGitHubLink(cb);
105105
}
106106

107-
function branchOnCallingContext(contexMenuParam, cb){
108-
if (contexMenuParam !== undefined) {
109-
fileFsPath = contexMenuParam._fsPath;
110-
getGitHubLinkForFile(fileFsPath, cb);
107+
function branchOnCallingContext(args, cb){
108+
if (args && args.fsPath) {
109+
getGitHubLinkForFile(args.fsPath, cb);
111110
}
112111
else if (Window.activeTextEditor) {
113112
getGitHubLinkForCurrentEditorLine(cb);
@@ -117,12 +116,12 @@ function branchOnCallingContext(contexMenuParam, cb){
117116
}
118117
}
119118

120-
function openInGitHub(contexMenuParam) {
121-
branchOnCallingContext(contexMenuParam, open);
119+
function openInGitHub(args) {
120+
branchOnCallingContext(args, open);
122121
}
123122

124-
function copyGitHubLinkToClipboard(contexMenuParam) {
125-
branchOnCallingContext(contexMenuParam, copy);
123+
function copyGitHubLinkToClipboard(args) {
124+
branchOnCallingContext(args, copy);
126125
}
127126

128127
function activate(context) {

0 commit comments

Comments
 (0)