[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0756c0b 53/78: avy.el (avy--overlay-at-full): Use avy--ove
From: |
Oleh Krehel |
Subject: |
[elpa] master 0756c0b 53/78: avy.el (avy--overlay-at-full): Use avy--overlay |
Date: |
Sat, 23 Jan 2016 14:00:12 +0000 |
branch: master
commit 0756c0b48ac03774c3e277ab759891c04e7bd416
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy.el (avy--overlay-at-full): Use avy--overlay
* avy.el (avy-styles-alist): Reset to nil.
(avy--overlay): Also set 'category to 'avy.
(avy--overlay-at-full): Use `avy--overlay'.
Fixes #110
---
avy.el | 45 +++++++++++++++++++++------------------------
1 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/avy.el b/avy.el
index 9e05c9f..1afba66 100644
--- a/avy.el
+++ b/avy.el
@@ -93,7 +93,7 @@ Use `avy-styles-alist' to customize this per-command."
(const :tag "Post" post)
(const :tag "De Bruijn" de-bruijn)))
-(defcustom avy-styles-alist '((avy-goto-line . pre))
+(defcustom avy-styles-alist nil
"Alist of avy-jump commands to the style for each command.
If the commands isn't on the list, `avy-style' is used."
:type '(alist
@@ -635,6 +635,7 @@ COMPOSE-FN is a lambda that concatenates the old string at
BEG with STR."
(when os-wrap-prefix
(add-text-properties 0 1 `(wrap-prefix ,os-wrap-prefix) str))
(overlay-put ol 'window wnd)
+ (overlay-put ol 'category 'avy)
(overlay-put ol 'display (funcall
(or compose-fn #'concat)
str old-str))
@@ -725,7 +726,8 @@ LEAF is normally ((BEG . END) . WND)."
'face 'avy-lead-face))
(len (length path))
(beg (avy-candidate-beg leaf))
- (wnd (cdr leaf)))
+ (wnd (cdr leaf))
+ end)
(dotimes (i len)
(set-text-properties (- len i 1) (- len i)
`(face ,(nth i avy-lead-faces))
@@ -739,33 +741,28 @@ LEAF is normally ((BEG . END) . WND)."
(with-selected-window wnd
(save-excursion
(goto-char beg)
- (let* ((len-and-str (avy--update-offset-and-str len str))
- (len (car len-and-str))
- (str (cdr len-and-str))
- (end (if (= beg (line-end-position))
+ (let ((len-and-str (avy--update-offset-and-str len str)))
+ (setq len (car len-and-str))
+ (setq str (cdr len-and-str))
+ (setq end (if (= beg (line-end-position))
(1+ beg)
(min (+ beg
(if (eq (char-after) ?\t)
1
len))
- (line-end-position))))
- (ol (make-overlay
- beg end
- (current-buffer)))
- (old-str (avy--old-str beg wnd)))
- (overlay-put ol 'window wnd)
- (overlay-put ol 'category 'avy)
- (overlay-put ol 'display
- (cond ((string= old-str "\n")
- (concat str "\n"))
- ((string= old-str "\t")
- (concat str (make-string (max (- tab-width len)
0) ?\ )))
- (t
- ;; add padding for wide-width character
- (if (eq (string-width old-str) 2)
- (concat str " ")
- str))))
- (push ol avy--overlays-lead))))))
+ (line-end-position)))))))
+ (avy--overlay
+ str beg end wnd
+ (lambda (str old-str)
+ (cond ((string= old-str "\n")
+ (concat str "\n"))
+ ((string= old-str "\t")
+ (concat str (make-string (max (- tab-width len) 0) ?\ )))
+ (t
+ ;; add padding for wide-width character
+ (if (eq (string-width old-str) 2)
+ (concat str " ")
+ str)))))))
(defun avy--overlay-post (path leaf)
"Create an overlay with PATH at LEAF.
- [elpa] master 513c429 41/78: Make avy-goto-char-timer faster for org-mode, (continued)
- [elpa] master 513c429 41/78: Make avy-goto-char-timer faster for org-mode, Oleh Krehel, 2016/01/23
- [elpa] master f28d238 46/78: Fix for combined org-indent-mode and visual-line-mode, Oleh Krehel, 2016/01/23
- [elpa] master 2313410 42/78: Optimize avy-goto-char-timer, Oleh Krehel, 2016/01/23
- [elpa] master 0166808 47/78: Beep when there are no matches, Oleh Krehel, 2016/01/23
- [elpa] master 2d07a49 50/78: Make avy--overlay-at use avy--overlay, Oleh Krehel, 2016/01/23
- [elpa] master cf36a59 48/78: avy.el (avy--old-str): New defun., Oleh Krehel, 2016/01/23
- [elpa] master 3257d81 49/78: Add avy-candidate-* helper functions, Oleh Krehel, 2016/01/23
- [elpa] master 13377d9 51/78: avy.el (avy--update-offset-and-str): Split from avy--overlay-at-full, Oleh Krehel, 2016/01/23
- [elpa] master d4b693f 52/78: avy.el (avy--overlay): Take BEG END, instead of only BEG, Oleh Krehel, 2016/01/23
- [elpa] master 567570a 54/78: Fix 'at-full moving text when visual-line-mode is on, Oleh Krehel, 2016/01/23
- [elpa] master 0756c0b 53/78: avy.el (avy--overlay-at-full): Use avy--overlay,
Oleh Krehel <=
- [elpa] master 1b78fb0 57/78: Improve the faces for the last change, Oleh Krehel, 2016/01/23
- [elpa] master dddce37 55/78: Fix 'at-full moving text for chars near end of visual line, Oleh Krehel, 2016/01/23
- [elpa] master edf1259 58/78: avy.el (avy--read-candidates): Use avy-dowindows, Oleh Krehel, 2016/01/23
- [elpa] master 9ae4413 56/78: Fix overlays at end-of-line with visual-line-mode, Oleh Krehel, 2016/01/23
- [elpa] master f341c2f 59/78: avy.el (avy--find-visible-regions): Add bounds safety, Oleh Krehel, 2016/01/23
- [elpa] master a041429 62/78: avy.el (avy-copy-region): Obey avy-line-insert-style, Oleh Krehel, 2016/01/23
- [elpa] master 54074c7 65/78: avy.el (avy-all-windows-alt): New defcustom, Oleh Krehel, 2016/01/23
- [elpa] master 54fb4d6 61/78: avy.el (avy-line-insert-style): Customize avy-copy-line, avy-move-line, Oleh Krehel, 2016/01/23
- [elpa] master 4a23a0d 60/78: Fix De Bruijn "No catch for tag" error, Oleh Krehel, 2016/01/23
- [elpa] master 4132dd6 63/78: avy.el (avy-goto-line-above): Work in a single window, Oleh Krehel, 2016/01/23