abo-abo / ace-window

Quickly switch windows in Emacs
970 stars 86 forks source link

BUG: Temporarily disable transient-mark-mode due to aw-display-mode-overlay interference #188

Closed rswgnu closed 4 years ago

rswgnu commented 4 years ago

If aw-display-mode-overlay is in use, display of the overlay messes up any current highlighted region (moving the active region to near the overlay inserted). To prevent this, simply temporarily disable transient-mark-mode while the window selection overlays are visible. Visually looks much better. Here is the patch to the latest version.

*** ace-window.el~  2020-02-01 14:37:57.000000000 -0500
--- ace-window.el   2020-02-01 17:45:44.000000000 -0500
***************
*** 571,576 ****
--- 571,577 ----
                     (unwind-protect
                          (let* ((avy-handler-function aw-dispatch-function)
                                 (avy-translate-char-function aw-translate-char-function)
+                  (transient-mark-mode)
                                 (res (avy-read (avy-tree candidate-list aw-keys)
                                                (if (and ace-window-display-mode
                                                         (null aw-display-mode-overlay))
abo-abo commented 4 years ago

Sorry, this patch isn't very readable due to github. Please open a PR.

rswgnu commented 4 years ago

Look at it again. I have formatted it properly now. It is a single line change.

abo-abo commented 4 years ago

Thanks.