branch: master
commit 974e55b792874cd4dab53bfc875b535001948a5f
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
avy-jump.el (avy--line): Avoid image-mode and doc-view-mode
Fixes #1
---
avy-jump.el | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/avy-jump.el b/avy-jump.el
index 5f8334a..89b8423 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -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