mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 21:33:05 +00:00
avy.el (avy--generic-jump): Add beg and end optional args
* avy.el (avy-goto-char-in-line): Update. Fixes #89
This commit is contained in:
parent
36b296c82a
commit
2c74d0160a
22
avy.el
22
avy.el
@ -765,16 +765,17 @@ LEAF is normally ((BEG . END) . WND)."
|
|||||||
(de-bruijn #'avy--overlay-at-full)
|
(de-bruijn #'avy--overlay-at-full)
|
||||||
(t (error "Unexpected style %S" style))))
|
(t (error "Unexpected style %S" style))))
|
||||||
|
|
||||||
(defun avy--generic-jump (regex window-flip style)
|
(defun avy--generic-jump (regex window-flip style &optional beg end)
|
||||||
"Jump to REGEX.
|
"Jump to REGEX.
|
||||||
When WINDOW-FLIP is non-nil, do the opposite of `avy-all-windows'.
|
When WINDOW-FLIP is non-nil, do the opposite of `avy-all-windows'.
|
||||||
STYLE determines the leading char overlay style."
|
STYLE determines the leading char overlay style.
|
||||||
|
BEG and END delimit the area where candidates are searched."
|
||||||
(let ((avy-all-windows
|
(let ((avy-all-windows
|
||||||
(if window-flip
|
(if window-flip
|
||||||
(not avy-all-windows)
|
(not avy-all-windows)
|
||||||
avy-all-windows)))
|
avy-all-windows)))
|
||||||
(avy--process
|
(avy--process
|
||||||
(avy--regex-candidates regex)
|
(avy--regex-candidates regex beg end)
|
||||||
(avy--style-fn style))))
|
(avy--style-fn style))))
|
||||||
|
|
||||||
;;* Commands
|
;;* Commands
|
||||||
@ -796,14 +797,13 @@ The window scope is determined by `avy-all-windows' (ARG negates it)."
|
|||||||
(defun avy-goto-char-in-line (char)
|
(defun avy-goto-char-in-line (char)
|
||||||
"Jump to the currently visible CHAR in the current line."
|
"Jump to the currently visible CHAR in the current line."
|
||||||
(interactive (list (read-char "char: " t)))
|
(interactive (list (read-char "char: " t)))
|
||||||
(let ((avy-all-windows nil))
|
(avy-with avy-goto-char
|
||||||
(avy-with avy-goto-char
|
(avy--generic-jump
|
||||||
(avy--process
|
(regexp-quote (string char))
|
||||||
(save-restriction
|
avy-all-windows
|
||||||
(narrow-to-region (line-beginning-position)
|
avy-style
|
||||||
(line-end-position))
|
(line-beginning-position)
|
||||||
(avy--regex-candidates (regexp-quote (string char))))
|
(line-end-position))))
|
||||||
(avy--style-fn avy-style)))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun avy-goto-char-2 (char1 char2 &optional arg)
|
(defun avy-goto-char-2 (char1 char2 &optional arg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user