emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 7376a0c 18/24: avy.el (avy--overlay-at-full): Fixup (for o


From: Oleh Krehel
Subject: [elpa] master 7376a0c 18/24: avy.el (avy--overlay-at-full): Fixup (for overlays-in)
Date: Thu, 25 Jun 2015 10:17:53 +0000

branch: master
commit 7376a0c6115addcafe35084181547af105ce060a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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.
---
 avy.el |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/avy.el b/avy.el
index 01acb2c..0caeb8a 100644
--- a/avy.el
+++ b/avy.el
@@ -596,12 +596,16 @@ LEAF is normally ((BEG . END) . WND)."
     (with-selected-window wnd
       (save-excursion
         (goto-char beg)
-        (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))
+        (when (setq oov
+                    (delq nil
+                          (mapcar
+                           (lambda (o)
+                             (and (eq (overlay-get o 'category) 'avy)
+                                  (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)))
         (let ((other-ov (cl-find-if
                          (lambda (o)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]