Add a magit-current-range variable for diff and log buffers.
This commit is contained in:
parent
81e2d01d03
commit
abe8a031ff
1 changed files with 12 additions and 0 deletions
12
magit.el
12
magit.el
|
@ -565,6 +565,16 @@ return nil."
|
||||||
|
|
||||||
;;; Revisions and ranges
|
;;; Revisions and ranges
|
||||||
|
|
||||||
|
(defvar magit-current-range nil
|
||||||
|
"The range described by the current buffer.
|
||||||
|
This is only non-nil in diff and log buffers.
|
||||||
|
|
||||||
|
This has three possible (non-nil) forms. If it's a string REF or
|
||||||
|
a singleton list (REF), then the range is from REF to the current
|
||||||
|
working directory state (or HEAD in a log buffer). If it's a
|
||||||
|
pair (START . END), then the range is START..END.")
|
||||||
|
(make-variable-buffer-local 'magit-current-range)
|
||||||
|
|
||||||
(defun magit-list-interesting-refs ()
|
(defun magit-list-interesting-refs ()
|
||||||
(let ((refs ()))
|
(let ((refs ()))
|
||||||
(dolist (line (magit-git-lines "show-ref"))
|
(dolist (line (magit-git-lines "show-ref"))
|
||||||
|
@ -3577,6 +3587,7 @@ With a non numeric prefix ARG, show all entries"
|
||||||
(defun magit-refresh-log-buffer (range style args)
|
(defun magit-refresh-log-buffer (range style args)
|
||||||
(magit-configure-have-graph)
|
(magit-configure-have-graph)
|
||||||
(magit-configure-have-decorate)
|
(magit-configure-have-decorate)
|
||||||
|
(setq magit-current-range range)
|
||||||
(magit-create-log-buffer-sections
|
(magit-create-log-buffer-sections
|
||||||
(apply #'magit-git-section nil
|
(apply #'magit-git-section nil
|
||||||
(magit-rev-range-describe range "Commits")
|
(magit-rev-range-describe range "Commits")
|
||||||
|
@ -3688,6 +3699,7 @@ level commits."
|
||||||
;;; Diffing
|
;;; Diffing
|
||||||
|
|
||||||
(defun magit-refresh-diff-buffer (range args)
|
(defun magit-refresh-diff-buffer (range args)
|
||||||
|
(setq magit-current-range range)
|
||||||
(magit-create-buffer-sections
|
(magit-create-buffer-sections
|
||||||
(magit-git-section 'diffbuf
|
(magit-git-section 'diffbuf
|
||||||
(magit-rev-range-describe range "Changes")
|
(magit-rev-range-describe range "Changes")
|
||||||
|
|
Loading…
Reference in a new issue