Skip to content

Commit

Permalink
magit-section--highlight-region: Change predicate order
Browse files Browse the repository at this point in the history
Check value of variable `magit-keep-region-overlay' first
because that is much cheaper than running the hook functions.
  • Loading branch information
tarsius committed Dec 20, 2019
1 parent e4b6497 commit 41f3e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lisp/magit-section.el
Original file line number Diff line number Diff line change
Expand Up @@ -1371,9 +1371,9 @@ invisible."

(defun magit-section--highlight-region (start end window rol)
(magit-section--delete-region-overlays)
(if (and (run-hook-with-args-until-success 'magit-region-highlight-hook
(if (and (not magit-keep-region-overlay)
(run-hook-with-args-until-success 'magit-region-highlight-hook
(magit-current-section))
(not magit-keep-region-overlay)
(not (= (line-number-at-pos start)
(line-number-at-pos end)))
;; (not (eq (car-safe last-command-event) 'mouse-movement))
Expand Down

0 comments on commit 41f3e2e

Please sign in to comment.