Modify avy--read-string-timer

This commit is contained in:
momomo5717 2015-09-19 18:24:26 +09:00
parent 22b4ff0658
commit acdd9e8b3d

14
avy.el
View File

@ -1047,7 +1047,7 @@ may be read if it is entered before `avy-timeout-seconds'. `DEL'
deletes the last char entered, and `RET' exits with the currently deletes the last char entered, and `RET' exits with the currently
read string immediately instead of waiting for another char for read string immediately instead of waiting for another char for
`avy-timeout-seconds'." `avy-timeout-seconds'."
(let ((str "") char break overlays) (let ((str "") char break overlays regex)
(unwind-protect (unwind-protect
(progn (progn
(while (and (not break) (while (and (not break)
@ -1077,11 +1077,13 @@ read string immediately instead of waiting for another char for
(when (>= (length str) 1) (when (>= (length str) 1)
(save-excursion (save-excursion
(goto-char (window-start)) (goto-char (window-start))
(while (re-search-forward (regexp-quote str) (window-end) t) (setq regex (regexp-quote str))
(let ((ov (make-overlay (match-beginning 0) (match-end 0)))) (while (re-search-forward regex (window-end) t)
(push ov overlays) (unless (get-char-property (point) 'invisible)
(overlay-put ov 'window (selected-window)) (let ((ov (make-overlay (match-beginning 0) (match-end 0))))
(overlay-put ov 'face 'avy-goto-char-timer-face)))))) (push ov overlays)
(overlay-put ov 'window (selected-window))
(overlay-put ov 'face 'avy-goto-char-timer-face)))))))
str) str)
(dolist (ov overlays) (dolist (ov overlays)
(delete-overlay ov))))) (delete-overlay ov)))))