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

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)
(let (git-link-use-commit)
(cl-destructuring-bind (beg end) (cl-destructuring-bind (beg end)
(if buffer-file-name (git-link--get-region)) (if buffer-file-name (git-link--get-region))
(let ((git-link-open-in-browser (not arg))) (let ((git-link-open-in-browser (not arg)))
(git-link (git-link--select-remote) beg end)))) (git-link (git-link--select-remote) beg end)))))
;;;###autoload ;;;###autoload
(defun +vc*update-header-line (revision) (defun +vc*update-header-line (revision)