avy.el (avy--overlay-at-full): Fixup (for overlays-in)

* avy.el (avy--overlay-at-full): Account for `overlays-in' not being
  returned in the buffer order sometimes: it seems to be random order.
  Instead, look at the minimum of all overlay starts that are on the
  current line.

Fixes #52.
This commit is contained in:
Oleh Krehel 2015-06-15 16:17:58 +02:00
parent 15c7f9fe39
commit 7376a0c611

16
avy.el
View File

@ -596,12 +596,16 @@ LEAF is normally ((BEG . END) . WND)."
(with-selected-window wnd (with-selected-window wnd
(save-excursion (save-excursion
(goto-char beg) (goto-char beg)
(when (setq oov (cl-find-if (lambda (o) (when (setq oov
(and (eq (overlay-get o 'category) 'avy) (delq nil
(eq (overlay-get o 'window) wnd))) (mapcar
(overlays-in (point) (min (+ (point) len) (lambda (o)
(line-end-position))))) (and (eq (overlay-get o 'category) 'avy)
(setq len (- (overlay-start oov) beg)) (eq (overlay-get o 'window) wnd)
(overlay-start o)))
(overlays-in (point) (min (+ (point) len)
(line-end-position))))))
(setq len (- (apply #'min oov) beg))
(setq str (substring str 0 len))) (setq str (substring str 0 len)))
(let ((other-ov (cl-find-if (let ((other-ov (cl-find-if
(lambda (o) (lambda (o)