]> code.delx.au - gnu-emacs-elpa/commitdiff
avy-jump.el (avi--line): Fixup the issue with org outlines
authorOleh Krehel <ohwoeowho@gmail.com>
Mon, 4 May 2015 19:51:08 +0000 (21:51 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 4 May 2015 19:51:08 +0000 (21:51 +0200)
Re #33

avy-jump.el

index 071128031d56a4848aec3baf2b330631ee6699e6..2ed91db558f2bc3e06b062f1c12812a745f28f1a 100644 (file)
@@ -257,14 +257,17 @@ Read one char with which the word should start."
 (defun avi--line ()
   "Select line in current window."
   (let ((avi-background nil)
+        (ws (window-start))
         candidates)
     (save-excursion
       (save-restriction
-        (narrow-to-region (window-start) (window-end (selected-window) t))
+        (narrow-to-region ws (window-end (selected-window) t))
         (goto-char (point-min))
         (while (< (point) (point-max))
-          (push (cons (point) (selected-window))
-                candidates)
+          (unless (get-char-property
+                   (max (1- (point)) ws) 'invisible)
+            (push (cons (point) (selected-window))
+                  candidates))
           (forward-line 1))))
     (avi--process (nreverse candidates) #'avi--overlay-pre)))