diff --git a/lib/git-link.js b/lib/git-link.js index cd0f9be..382eed4 100644 --- a/lib/git-link.js +++ b/lib/git-link.js @@ -152,39 +152,15 @@ export default { // Open actions (e.g. open in browser) async linkFile() { const link = await this.file() - if (!link) { - return false - } - - if (this.openLinkOnDoubleCopy && this.openLinkIfMatchesClipboard(link)) { - return - } - atom.clipboard.write(link) - atom.notifications.addInfo('Copied link for current file to clipboard', { detail: link }) + this.handleCopy(link, 'Copied link for current file to clipboard') }, async linkLine() { const link = await this.line() - if (!link) { - return false - } - - if (this.openLinkOnDoubleCopy && this.openLinkIfMatchesClipboard(link)) { - return - } - atom.clipboard.write(link) - atom.notifications.addInfo('Copied link for current line to clipboard', { detail: link }) + this.handleCopy(link, 'Copied link for current line to clipboard') }, async linkSelection() { const link = await this.selection() - if (!link) { - return false - } - - if (this.openLinkOnDoubleCopy && this.openLinkIfMatchesClipboard(link)) { - return - } - atom.clipboard.write(link) - atom.notifications.addInfo('Copied link for current selection to clipboard', { detail: link }) + this.handleCopy(link, 'Copied link for current selection to clipboard') }, async linkRepository() {