mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
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
This commit is contained in:
parent
0d83599d80
commit
b602a560be
13
avy.el
13
avy.el
@ -219,7 +219,12 @@ CLEANUP-FN should take no arguments and remove the effects of
|
|||||||
multiple DISPLAY-FN invokations."
|
multiple DISPLAY-FN invokations."
|
||||||
(catch 'done
|
(catch 'done
|
||||||
(while tree
|
(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))
|
(let ((char (read-char))
|
||||||
branch)
|
branch)
|
||||||
(funcall cleanup-fn)
|
(funcall cleanup-fn)
|
||||||
@ -417,6 +422,11 @@ LEAF is normally ((BEG . END) . WND)."
|
|||||||
(with-selected-window wnd
|
(with-selected-window wnd
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char beg)
|
(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))
|
(let* ((end (if (= beg (line-end-position))
|
||||||
(1+ beg)
|
(1+ beg)
|
||||||
(min (+ beg len) (line-end-position))))
|
(min (+ beg len) (line-end-position))))
|
||||||
@ -428,6 +438,7 @@ LEAF is normally ((BEG . END) . WND)."
|
|||||||
(setq old-str (propertize
|
(setq old-str (propertize
|
||||||
old-str 'face 'avy-background-face)))
|
old-str 'face 'avy-background-face)))
|
||||||
(overlay-put ol 'window wnd)
|
(overlay-put ol 'window wnd)
|
||||||
|
(overlay-put ol 'category 'avy)
|
||||||
(overlay-put ol 'display (if (string= old-str "\n")
|
(overlay-put ol 'display (if (string= old-str "\n")
|
||||||
(concat str "\n")
|
(concat str "\n")
|
||||||
str))
|
str))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user