From rmuslimov/browse-at-remote@1a9392e

rmuslimov/browse-at-remote#59 upstreamed some of our local changes.
This commit is contained in:
Henrik Lissner 2020-02-09 19:01:36 -05:00
parent 5e0e0bd3b7
commit e241fa347b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 2 additions and 15 deletions

View file

@ -3,26 +3,13 @@
(autoload 'browse-at-remote-get-url "browse-at-remote") (autoload 'browse-at-remote-get-url "browse-at-remote")
(autoload 'browse-at-remote--file-url "browse-at-remote") (autoload 'browse-at-remote--file-url "browse-at-remote")
(defun +vc--remote-file-or-region-link ()
(if (or (doom-region-active-p) (not buffer-file-name))
(browse-at-remote-get-url)
(browse-at-remote--file-url (buffer-file-name))))
;;;###autoload
(defun +vc/browse-at-remote-file-or-region ()
"Open the current file at remote in your browser.
If a selection is active, highlight them. Otherwise omits the #L<N> suffix in
the URL."
(interactive)
(browse-url (+vc--remote-file-or-region-link)))
;;;###autoload ;;;###autoload
(defun +vc/browse-at-remote-kill-file-or-region () (defun +vc/browse-at-remote-kill-file-or-region ()
"Copy the current file's remote URL to your clipboard. "Copy the current file's remote URL to your clipboard.
If a selection is active, highlight them. Otherwise omits the #L<N> suffix in If a selection is active, highlight them. Otherwise omits the #L<N> suffix in
the URL." the URL."
(interactive) (interactive)
(let ((url (+vc--remote-file-or-region-link))) (let ((url (browse-at-remote-get-url)))
(kill-new url) (kill-new url)
(message "Copied to clipboard: %S" url))) (message "Copied to clipboard: %S" url)))

View file

@ -5,7 +5,7 @@
(package! vc-annotate :built-in t) (package! vc-annotate :built-in t)
(package! smerge-mode :built-in t) (package! smerge-mode :built-in t)
(package! browse-at-remote :pin "1a9392e9d1") (package! browse-at-remote :pin "aeee6bf38f")
(package! git-timemachine :pin "391eb61050") (package! git-timemachine :pin "391eb61050")
(package! gitconfig-mode :pin "55468314a5") (package! gitconfig-mode :pin "55468314a5")
(package! gitignore-mode :pin "55468314a5") (package! gitignore-mode :pin "55468314a5")