branch: master
commit fcc64abf2e8c4e0420f07db9a26f7b353d7f607e
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
avy-jump.el (avi--regex-candidates): Add optional bounds
---
avy-jump.el | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/avy-jump.el b/avy-jump.el
index 5045160..672ffcb 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -75,16 +75,16 @@ POS is either a position or (BEG . END)."
#'aw--remove-leading-chars))))
(aw--done)))
-(defun avi--regex-candidates (regex &optional wnd)
+(defun avi--regex-candidates (regex &optional wnd beg end)
"Return all elements that match REGEX in WND.
Each element of the list is ((BEG . END) . WND)."
(setq wnd (or wnd (selected-window)))
- (let ((we (window-end (selected-window) t))
+ (let ((we (or end (window-end (selected-window) t)))
candidates)
(save-window-excursion
(select-window wnd)
(save-excursion
- (goto-char (window-start))
+ (goto-char (or beg (window-start)))
(while (re-search-forward regex we t)
(push (cons (cons (match-beginning 0)
(match-end 0))