Avoid image-mode and doc-view-mode

* avy-jump.el (avy--regex-candidates): Update.

Re #1
This commit is contained in:
Oleh Krehel 2015-05-05 17:39:41 +02:00
parent 6c1f2f6423
commit 1684e6af02

View File

@ -129,16 +129,17 @@ When PRED is non-nil, it's a filter for matching point positions."
(window-list) (window-list)
(list (selected-window)))) (list (selected-window))))
(with-selected-window wnd (with-selected-window wnd
(let ((we (or end (window-end (selected-window) t)))) (unless (memq major-mode '(image-mode doc-view-mode))
(save-excursion (let ((we (or end (window-end (selected-window) t))))
(goto-char (or beg (window-start))) (save-excursion
(while (re-search-forward regex we t) (goto-char (or beg (window-start)))
(unless (get-char-property (point) 'invisible) (while (re-search-forward regex we t)
(when (or (null pred) (unless (get-char-property (point) 'invisible)
(funcall pred)) (when (or (null pred)
(push (cons (cons (match-beginning 0) (funcall pred))
(match-end 0)) (push (cons (cons (match-beginning 0)
wnd) candidates)))))))) (match-end 0))
wnd) candidates)))))))))
(nreverse candidates))) (nreverse candidates)))
(defvar avy--overlay-offset 0 (defvar avy--overlay-offset 0