From 196382b5c85f110873156463fc387e39334a9880 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Mon, 13 May 2019 12:48:16 +0200 Subject: [PATCH] ace-window.el (aw-display-mode-overlay): New defcustom Fixes #173 --- ace-window.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ace-window.el b/ace-window.el index ba4decc..01385bd 100644 --- a/ace-window.el +++ b/ace-window.el @@ -498,6 +498,12 @@ The new frame is set to the same size as the previous frame, offset by (let ((avy-dispatch-alist)) (avy-handler-default char))))))) +(defcustom aw-display-mode-overlay t + "When nil, don't display overlays. Rely on the mode line instead." + :type 'boolean) + +(defvar ace-window-display-mode) + (defun aw-select (mode-line &optional action) "Return a selected other window. Amend MODE-LINE to the mode line for the duration of the selection." @@ -543,7 +549,10 @@ Amend MODE-LINE to the mode line for the duration of the selection." (let* ((avy-handler-function aw-dispatch-function) (avy-translate-char-function aw-translate-char-function) (res (avy-read (avy-tree candidate-list aw-keys) - #'aw--lead-overlay + (if (and ace-window-display-mode + aw-display-mode-overlay) + #'aw--lead-overlay + (lambda (_path _leaf))) #'avy--remove-leading-chars))) (if (eq res 'exit) (setq aw-action nil)