avy.el (avy--overlay-at-full): Improve

Re #51
This commit is contained in:
Oleh Krehel 2015-05-26 16:59:01 +02:00
parent b5e02ac61c
commit 9ddde6dd79

17
avy.el
View File

@ -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)