branch: master commit b602a560be17d8f0ac8147053ee104173a92fd9f Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
Stop 'at-full from shifting text * avy.el (avy-read): Call DISPLAY-FN in buffer's reverse order. (avy--overlay-at-full): When there's an avy overlay after point, shorten the current overlay to one letter. Re #5 --- avy.el | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/avy.el b/avy.el index 17e8260..17caaf5 100644 --- a/avy.el +++ b/avy.el @@ -219,7 +219,12 @@ CLEANUP-FN should take no arguments and remove the effects of multiple DISPLAY-FN invokations." (catch 'done (while tree - (avy-traverse tree display-fn) + (let ((avy--leafs nil)) + (avy-traverse tree + (lambda (path leaf) + (push (cons path leaf) avy--leafs))) + (dolist (x avy--leafs) + (funcall display-fn (car x) (cdr x)))) (let ((char (read-char)) branch) (funcall cleanup-fn) @@ -417,6 +422,11 @@ LEAF is normally ((BEG . END) . WND)." (with-selected-window wnd (save-excursion (goto-char beg) + (when (cl-some (lambda (o) + (eq (overlay-get o 'category) 'avy)) + (overlays-at (1+ (point)))) + (setq str (substring str 0 1)) + (setq len 1)) (let* ((end (if (= beg (line-end-position)) (1+ beg) (min (+ beg len) (line-end-position)))) @@ -428,6 +438,7 @@ LEAF is normally ((BEG . END) . WND)." (setq old-str (propertize old-str 'face 'avy-background-face))) (overlay-put ol 'window wnd) + (overlay-put ol 'category 'avy) (overlay-put ol 'display (if (string= old-str "\n") (concat str "\n") str))