[Top][All Lists]

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

[elpa] master 002b8f3 091/110: avy.el (avy--visible-p): Add to fix org-t

From: Oleh Krehel
Subject: [elpa] master 002b8f3 091/110: avy.el (avy--visible-p): Add to fix org-toggle-link-display
Date: Sat, 11 May 2019 10:15:51 -0400 (EDT)

branch: master
commit 002b8f3451210a29d588852b6f7c21fc2800e700
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    avy.el (avy--visible-p): Add to fix org-toggle-link-display
    Fixes #261
 avy.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/avy.el b/avy.el
index eb48403..986e7d0 100644
--- a/avy.el
+++ b/avy.el
@@ -837,18 +837,23 @@ Use OVERLAY-FN to visualize the decision overlay."
   (setq avy--overlays-back nil)
+(defun avy--visible-p (s)
+  (let ((invisible (get-char-property s 'invisible)))
+    (or (null invisible)
+        (null (assoc invisible buffer-invisibility-spec)))))
 (defun avy--next-visible-point ()
   "Return the next closest point without 'invisible property."
   (let ((s (point)))
     (while (and (not (= (point-max) (setq s (next-char-property-change s))))
-                (get-char-property s 'invisible)))
+                (not (avy--visible-p s))))
 (defun avy--next-invisible-point ()
   "Return the next closest point with 'invisible property."
   (let ((s (point)))
     (while (and (not (= (point-max) (setq s (next-char-property-change s))))
-                (not (get-char-property s 'invisible))))
+                (avy--visible-p s)))
 (defun avy--find-visible-regions (rbeg rend)
@@ -883,7 +888,7 @@ When GROUP is non-nil, (BEG . END) should delimit that 
regex group."
           (goto-char (car pair))
           (while (re-search-forward regex (cdr pair) t)
-            (unless (get-char-property (1- (point)) 'invisible)
+            (when (avy--visible-p (1- (point)))
               (when (or (null pred)
                         (funcall pred))
                 (push (cons (cons (match-beginning group)

reply via email to

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