[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 02bf35b 13/24: Modify `at-full' and `de-bruijn' overlays t
From: |
Oleh Krehel |
Subject: |
[elpa] master 02bf35b 13/24: Modify `at-full' and `de-bruijn' overlays to color depth |
Date: |
Thu, 25 Jun 2015 10:17:51 +0000 |
branch: master
commit 02bf35b6a095100b7b88dc099765534e448823af
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Modify `at-full' and `de-bruijn' overlays to color depth
* avy.el (avy-lead-face-2): New face.
(avy-lead-faces): New defconst. Each element will be used to color the
corresponding depth.
(avy--overlay-at-full): Use `avy-lead-faces' to represent the current
decision depth. For `de-bruijn', prepend the old stuff, so that nothing
moves.
Fixes #53
---
avy.el | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/avy.el b/avy.el
index 11b724e..427378d 100644
--- a/avy.el
+++ b/avy.el
@@ -142,6 +142,10 @@ Typically, these modes don't use the text representation.")
'((t (:foreground "white" :background "gray")))
"Face used for matched leading chars.")
+(defface avy-lead-face-2
+ '((t (:foreground "white" :background "#f86bf3")))
+ "Face used for leading chars.")
+
(defface avy-lead-face
'((t (:foreground "white" :background "#e52b50")))
"Face used for the leading chars.")
@@ -150,6 +154,14 @@ Typically, these modes don't use the text representation.")
'((t (:foreground "gray40")))
"Face for whole window background during selection.")
+(defconst avy-lead-faces '(avy-lead-face
+ avy-lead-face-0
+ avy-lead-face-2
+ avy-lead-face
+ avy-lead-face-0
+ avy-lead-face-2)
+ "Face sequence for `avy--overlay-at-full'.")
+
;;* Internals
;;** Tree
(defmacro avy-multipop (lst n)
@@ -566,8 +578,16 @@ LEAF is normally ((BEG . END) . WND)."
(car leaf)))
(wnd (cdr leaf))
oov)
- (when (or avy-highlight-first (> (length str) 1))
- (set-text-properties 0 1 '(face avy-lead-face-0) str))
+ (dotimes (i len)
+ (set-text-properties (- len i 1) (- len i)
+ `(face ,(nth i avy-lead-faces))
+ str))
+ (when (eq avy-style 'de-bruijn)
+ (setq str (concat
+ (propertize avy-current-path
+ 'face 'avy-lead-face-1)
+ str))
+ (setq len (length str)))
(with-selected-window wnd
(save-excursion
(goto-char beg)
- [elpa] master 9ddde6d 06/24: avy.el (avy--overlay-at-full): Improve, (continued)
- [elpa] master 9ddde6d 06/24: avy.el (avy--overlay-at-full): Improve, Oleh Krehel, 2015/06/25
- [elpa] master 44d76b9 22/24: Bump version to 0.3.0, Oleh Krehel, 2015/06/25
- [elpa] master 791c16c 02/24: avy.el (avy-goto-char-in-line): New command, Oleh Krehel, 2015/06/25
- [elpa] master 6dfa445 12/24: README.md: Mention a custom-command tutorial, Oleh Krehel, 2015/06/25
- [elpa] master 7376a0c 18/24: avy.el (avy--overlay-at-full): Fixup (for overlays-in), Oleh Krehel, 2015/06/25
- [elpa] master 15c7f9f 17/24: targets/avy-init.el: Use the new checkdoc-file, Oleh Krehel, 2015/06/25
- [elpa] master 035d663 14/24: Add `avy-translate-char-function' to translate user input key, Oleh Krehel, 2015/06/25
- [elpa] master 27b98bb 03/24: Add 'de-bruijn option for avy-style, Oleh Krehel, 2015/06/25
- [elpa] master a7c92d8 21/24: Updated screenshot image for ivy-goto-char., Oleh Krehel, 2015/06/25
- [elpa] master f727b53 24/24: Merge commit '8d38a898f23b3105c5d098f0cfb6c3383547e394' from avy, Oleh Krehel, 2015/06/25
- [elpa] master 02bf35b 13/24: Modify `at-full' and `de-bruijn' overlays to color depth,
Oleh Krehel <=
- [elpa] master 236293a 15/24: avy.el (avy-isearch): Allow different styles, Oleh Krehel, 2015/06/25
- [elpa] master 054390f 16/24: avy.el (avy-translate-char-function): Fixup doc, Oleh Krehel, 2015/06/25
- [elpa] master 78d20e0 07/24: Fix jumping to other frames, Oleh Krehel, 2015/06/25
- [elpa] master 7a00821 09/24: avy.el (avy-dowindows): Ignore pdf-view-mode, Oleh Krehel, 2015/06/25
- [elpa] master e5104ca 20/24: avy.el (avy-goto-word-1): Quote punctuation, Oleh Krehel, 2015/06/25
- [elpa] master 55c77c5 04/24: For De Bruin, don't build a tree, Oleh Krehel, 2015/06/25
- [elpa] master aa2eb24 01/24: Makefile: "all" should depend on "compile", Oleh Krehel, 2015/06/25
- [elpa] master b5e02ac 05/24: Fixup byte-compile warnings, Oleh Krehel, 2015/06/25