branch: master commit 002b8f3451210a29d588852b6f7c21fc2800e700 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
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) (avy--remove-leading-chars)) +(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)))) 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))) s)) (defun avy--find-visible-regions (rbeg rend) @@ -883,7 +888,7 @@ When GROUP is non-nil, (BEG . END) should delimit that regex group." (save-excursion (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)