]> code.delx.au - gnu-emacs-elpa/commitdiff
avy-jump.el (avy--line): Avoid image-mode and doc-view-mode
authorOleh Krehel <ohwoeowho@gmail.com>
Thu, 7 May 2015 11:02:20 +0000 (13:02 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 7 May 2015 11:02:20 +0000 (13:02 +0200)
Fixes #1

avy-jump.el

index 5f8334a4e6dd081b22ffb26a360b05efb750f69d..89b84238497ac58008ad43d6f2d4aa6e8324b4aa 100644 (file)
@@ -339,17 +339,18 @@ The window scope is determined by `avy-all-windows' (ARG negates it)."
                      (window-list)
                    (list (selected-window))))
       (with-selected-window wnd
-        (let ((ws (window-start)))
-          (save-excursion
-            (save-restriction
-              (narrow-to-region ws (window-end (selected-window) t))
-              (goto-char (point-min))
-              (while (< (point) (point-max))
-                (unless (get-char-property
-                         (max (1- (point)) ws) 'invisible)
-                  (push (cons (point) (selected-window))
-                        candidates))
-                (forward-line 1)))))))
+        (unless (memq major-mode '(image-mode doc-view-mode))
+          (let ((ws (window-start)))
+            (save-excursion
+              (save-restriction
+                (narrow-to-region ws (window-end (selected-window) t))
+                (goto-char (point-min))
+                (while (< (point) (point-max))
+                  (unless (get-char-property
+                           (max (1- (point)) ws) 'invisible)
+                    (push (cons (point) (selected-window))
+                          candidates))
+                  (forward-line 1))))))))
     (avy--process (nreverse candidates) #'avy--overlay-pre)))
 
 ;;;###autoload