Fix browse-at-remote commands in magit

This commit is contained in:
Henrik Lissner 2020-01-08 00:34:41 -05:00
parent 345479c29e
commit dfbaccca90
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -9,7 +9,7 @@
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)
(if (doom-region-active-p) (if (or (doom-region-active-p) (not buffer-file-name))
(browse-at-remote) (browse-at-remote)
(browse-url (browse-at-remote--file-url (buffer-file-name))))) (browse-url (browse-at-remote--file-url (buffer-file-name)))))
@ -20,7 +20,7 @@ If a selection is active, highlight them. Otherwise omits the #L<N> suffix in
the URL." the URL."
(interactive) (interactive)
(let ((url (let ((url
(if (doom-region-active-p) (if (or (doom-region-active-p) (not buffer-file-name))
(browse-at-remote-get-url) (browse-at-remote-get-url)
(browse-at-remote--file-url (buffer-file-name))))) (browse-at-remote--file-url (buffer-file-name)))))
(kill-new url) (kill-new url)