diff options
| author | Kyle Meyer <kyle@kyleam.com> | 2015-08-11 01:15:04 -0400 |
|---|---|---|
| committer | Kyle Meyer <kyle@kyleam.com> | 2015-08-11 01:24:43 -0400 |
| commit | c8d40a2e34eae7ed6fceb4884f3ed6ed105cea80 (patch) | |
| tree | 682c34ccc59f7e3ec093578223c315728be10b4d /lisp | |
| parent | a26f515928af7da2f3f6cfd318f8d9320ce52950 (diff) | |
magit-log-maybe-show-commit: show endpoint commit
Show commit that is current when the idle timer function is called, not
when the timer is set.
Fixes #2161.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/magit-log.el | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/lisp/magit-log.el b/lisp/magit-log.el index d657320..2497ccc 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -942,7 +942,7 @@ and `magit-log-auto-more' is non-nil." (defvar magit-log-show-commit-timer nil) -(defun magit-log-maybe-show-commit (&optional section) +(defun magit-log-maybe-show-commit (&optional _) "Automatically show commit at point in another window. If the section at point is a `commit' section and the value of `magit-diff-auto-show-p' calls for it, then show that commit in @@ -951,27 +951,24 @@ another window, using `magit-show-commit'." (setq magit-log-show-commit-timer (run-with-idle-timer magit-diff-auto-show-delay nil - (-partial - (lambda (section) - (--when-let - (or (and section - (eq (magit-section-type section) 'commit) - (or (and (magit-diff-auto-show-p 'log-follow) - (magit-mode-get-buffer - magit-revision-buffer-name-format - 'magit-revision-mode)) - (and (magit-diff-auto-show-p 'log-oneline) - (derived-mode-p 'magit-log-mode))) - (magit-section-value section)) - (and magit-blame-mode - (magit-diff-auto-show-p 'blame-follow) - (magit-mode-get-buffer - magit-revision-buffer-name-format - 'magit-revision-mode) - (magit-blame-chunk-get :hash))) - (magit-show-commit it t)) - (setq magit-log-show-commit-timer nil)) - section))))) + (lambda () + (--when-let + (or (magit-section-when commit + (and (or (and (magit-diff-auto-show-p 'log-follow) + (magit-mode-get-buffer + magit-revision-buffer-name-format + 'magit-revision-mode)) + (and (magit-diff-auto-show-p 'log-oneline) + (derived-mode-p 'magit-log-mode))) + (magit-section-value it))) + (and magit-blame-mode + (magit-diff-auto-show-p 'blame-follow) + (magit-mode-get-buffer + magit-revision-buffer-name-format + 'magit-revision-mode) + (magit-blame-chunk-get :hash))) + (magit-show-commit it t)) + (setq magit-log-show-commit-timer nil)))))) (defun magit-log-goto-same-commit () (--when-let |
