[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c6652b2 02/22: swiper.el (swiper--add-overlays): Make boun
From: |
Oleh Krehel |
Subject: |
[elpa] master c6652b2 02/22: swiper.el (swiper--add-overlays): Make bounds optional |
Date: |
Wed, 22 Apr 2015 19:51:45 +0000 |
branch: master
commit c6652b21c7b39dc9fbf3d4b7b48188b943e3783c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--add-overlays): Make bounds optional
---
swiper.el | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/swiper.el b/swiper.el
index b46702b..f123c73 100644
--- a/swiper.el
+++ b/swiper.el
@@ -236,8 +236,9 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(recenter)))
(swiper--add-overlays re))))
-(defun swiper--add-overlays (re)
- "Add overlays for RE regexp in visible part of the current buffer."
+(defun swiper--add-overlays (re &optional beg end)
+ "Add overlays for RE regexp in visible part of the current buffer.
+BEG and END, when specified, are the point bounds."
(let ((ov (make-overlay
(line-beginning-position)
(1+ (line-end-position)))))
@@ -245,12 +246,12 @@ When non-nil, INITIAL-INPUT is the initial search
pattern."
(overlay-put ov 'window swiper--window)
(push ov swiper--overlays))
(let* ((wh (window-height))
- (beg (save-excursion
- (forward-line (- wh))
- (point)))
- (end (save-excursion
- (forward-line wh)
- (point))))
+ (beg (or beg (save-excursion
+ (forward-line (- wh))
+ (point))))
+ (end (or end (save-excursion
+ (forward-line wh)
+ (point)))))
(when (>= (length re) swiper-min-highlight)
(save-excursion
(goto-char beg)
- [elpa] master updated (e86b27e -> c7a6156), Oleh Krehel, 2015/04/22
- [elpa] master dea7858 01/22: counsel.el (counsel-git-grep-count): Ignore case, Oleh Krehel, 2015/04/22
- [elpa] master c6652b2 02/22: swiper.el (swiper--add-overlays): Make bounds optional,
Oleh Krehel <=
- [elpa] master 769023b 03/22: ivy.el (ivy-read): Use initial-input when completing files, Oleh Krehel, 2015/04/22
- [elpa] master 12c25a0 04/22: ivy.el (ivy-read): Don't add the `default-directory', Oleh Krehel, 2015/04/22
- [elpa] master 37d371c 05/22: Add a way to exit ignoring the candidates, Oleh Krehel, 2015/04/22
- [elpa] master 4adc074 06/22: Fix the default-directory for `counsel-git-grep', Oleh Krehel, 2015/04/22
- [elpa] master dd559ad 07/22: ivy.el (ivy--filter): Try directory expansion with "/", Oleh Krehel, 2015/04/22
- [elpa] master 6da7819 09/22: ivy.el (ivy--filter): Update prefix optimization, Oleh Krehel, 2015/04/22
- [elpa] master 533b788 11/22: ivy.el (ivy-done): Be more strict for `require-match', Oleh Krehel, 2015/04/22
- [elpa] master fb805a0 08/22: README.md: Add a note on outdated ivy package, Oleh Krehel, 2015/04/22
- [elpa] master 70c5fe8 13/22: Bind "M-q" to `ivy-toggle-regexp-quote', Oleh Krehel, 2015/04/22
- [elpa] master 7edfbc9 14/22: ivy.el (ivy--exhibit): Wrap in `while-no-input', Oleh Krehel, 2015/04/22