summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-12-09 14:32:04 -0500
committerKyle Meyer <kyle@kyleam.com>2018-12-09 14:32:04 -0500
commit97081cd777837824b0df441314343ed252a05405 (patch)
tree27646cff51207a04c0088abbf34cf5736676e6b3 /lisp
parentbd71d692966ea68545bb0181f5644872fbcb3147 (diff)
downloademacs.d-97081cd777837824b0df441314343ed252a05405.tar.gz
km/magit-log-dwim: Consider active region
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el6
1 files changed, 5 insertions, 1 deletions
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