branch: master
commit 9ddde6dd797f5ba02db2d7e26dae531b59b0b3b6
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
avy.el (avy--overlay-at-full): Improve
Re #51
---
avy.el | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/avy.el b/avy.el
index bca174f..8ca8350 100644
--- a/avy.el
+++ b/avy.el
@@ -556,19 +556,20 @@ LEAF is normally ((BEG . END) . WND)."
(beg (if (consp (car leaf))
(caar leaf)
(car leaf)))
- (wnd (cdr leaf)))
+ (wnd (cdr leaf))
+ oov)
(when (or avy-highlight-first (> (length str) 1))
(set-text-properties 0 1 '(face avy-lead-face-0) str))
(with-selected-window wnd
(save-excursion
(goto-char beg)
- (when (cl-some (lambda (o)
- (and (eq (overlay-get o 'category) 'avy)
- (eq (overlay-get o 'window) wnd)))
- (overlays-in (point) (min (+ (point) len)
- (line-end-position))))
- (setq str (substring str 0 1))
- (setq len 1))
+ (when (setq oov (cl-find-if (lambda (o)
+ (and (eq (overlay-get o 'category) 'avy)
+ (eq (overlay-get o 'window) wnd)))
+ (overlays-in (point) (min (+ (point) len)
+
(line-end-position)))))
+ (setq len (- (overlay-start oov) beg))
+ (setq str (substring str 0 len)))
(let ((other-ov (cl-find-if
(lambda (o)
(and (eq (overlay-get o 'category) 'avy)