mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
Fix jumping to newlines with at-full style
* avy-jump.el (avy--overlay-at-full): Update. Re #5
This commit is contained in:
parent
3716cd0b02
commit
a08b049edd
18
avy-jump.el
18
avy-jump.el
@ -280,14 +280,20 @@ LEAF is normally ((BEG . END) . WND)."
|
|||||||
(apply #'string (reverse path))
|
(apply #'string (reverse path))
|
||||||
'face 'avy-lead-face))
|
'face 'avy-lead-face))
|
||||||
(len (length path))
|
(len (length path))
|
||||||
(pt (if (consp (car leaf))
|
(beg (if (consp (car leaf))
|
||||||
(caar leaf)
|
(caar leaf)
|
||||||
(car leaf)))
|
(car leaf)))
|
||||||
(wnd (cdr leaf)))
|
(wnd (cdr leaf)))
|
||||||
(let ((ol (make-overlay pt (+ pt len)
|
(with-selected-window wnd
|
||||||
(window-buffer wnd)))
|
(save-excursion
|
||||||
(old-str (with-selected-window wnd
|
(goto-char beg)
|
||||||
(buffer-substring pt (1+ pt)))))
|
(let* ((end (if (= beg (line-end-position))
|
||||||
|
(1+ beg)
|
||||||
|
(min (+ beg len) (line-end-position))))
|
||||||
|
(ol (make-overlay
|
||||||
|
beg end
|
||||||
|
(current-buffer)))
|
||||||
|
(old-str (buffer-substring beg (1+ beg))))
|
||||||
(when avy-background
|
(when avy-background
|
||||||
(setq old-str (propertize
|
(setq old-str (propertize
|
||||||
old-str 'face 'avy-background-face)))
|
old-str 'face 'avy-background-face)))
|
||||||
@ -295,7 +301,7 @@ LEAF is normally ((BEG . END) . WND)."
|
|||||||
(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))
|
||||||
(push ol avy--overlays-lead))))
|
(push ol avy--overlays-lead))))))
|
||||||
|
|
||||||
(defun avy--overlay-post (path leaf)
|
(defun avy--overlay-post (path leaf)
|
||||||
"Create an overlay with PATH at LEAF.
|
"Create an overlay with PATH at LEAF.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user