From 97081cd777837824b0df441314343ed252a05405 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 9 Dec 2018 14:32:04 -0500 Subject: km/magit-log-dwim: Consider active region --- lisp/km-magit.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/km-magit.el b/lisp/km-magit.el index 69f5f2b..56921e6 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -565,7 +565,11 @@ argument. Interactively, this can be accessed using the command (defun km/magit-log-dwim (&optional args files) (interactive (magit-log-arguments)) (let ((range - (or (magit-section-case + (or (and (use-region-p) + (prog1 (buffer-substring-no-properties + (region-beginning) (region-end)) + (deactivate-mark))) + (magit-section-case ((unpushed unpulled) (oref it value)) (tag -- cgit v1.2.3