Fix +vc/git-browse-region-or-line

git-link-use-commit = t breaks +vc/git-browse-region-or-line.
This commit is contained in:
Henrik Lissner 2019-06-01 20:20:11 -04:00
parent 1de21f57eb
commit 36a8e02857
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -12,16 +12,18 @@
(error "Remote `%s' is unknown or contains an unsupported URL" remote)))) (error "Remote `%s' is unknown or contains an unsupported URL" remote))))
(defvar git-link-open-in-browser) (defvar git-link-open-in-browser)
(defvar git-link-use-commit)
;;;###autoload ;;;###autoload
(defun +vc/git-browse-region-or-line (&optional arg) (defun +vc/git-browse-region-or-line (&optional arg)
"Open the website for the current version controlled file. Fallback to "Open the website for the current version controlled file. Fallback to
repository root." repository root."
(interactive "P") (interactive "P")
(require 'git-link) (require 'git-link)
(cl-destructuring-bind (beg end) (let (git-link-use-commit)
(if buffer-file-name (git-link--get-region)) (cl-destructuring-bind (beg end)
(let ((git-link-open-in-browser (not arg))) (if buffer-file-name (git-link--get-region))
(git-link (git-link--select-remote) beg end)))) (let ((git-link-open-in-browser (not arg)))
(git-link (git-link--select-remote) beg end)))))
;;;###autoload ;;;###autoload
(defun +vc*update-header-line (revision) (defun +vc*update-header-line (revision)