branch: elpa/isl
commit 6a7aa474492c1bd6b07d3bfcfbeaa1fae2f3ec9b
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Allow matching empty lines
---
isl.el | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/isl.el b/isl.el
index efe69ec77a7..d782539b107 100644
--- a/isl.el
+++ b/isl.el
@@ -415,8 +415,9 @@ It put overlay on current position, move to next overlay
using
(interactive)
(with-selected-window (minibuffer-selected-window)
;; Ensure user haven't scrolled to another place.
- (let ((end (overlay-end isl--last-overlay)))
- (goto-char (if isl-multi-search-in-line
+ (let ((end (overlay-end isl--last-overlay))
+ (lp (overlay-get isl--last-overlay 'line-prefix)))
+ (goto-char (if (or isl-multi-search-in-line lp)
(1- end) end)))
(when isl-multi-search-in-line
(let* ((ovs (overlays-in (pos-bol) (pos-eol)))
@@ -884,14 +885,21 @@ See `isl-requires-pattern'."
(while (setq bounds (isl-multi-search-fwd isl-pattern nil t))
(unless (and (not isl-search-invisible)
(invisible-p (cdr bounds)))
- (setq ov (make-overlay (car bounds) (cdr bounds)))
+ (setq ov (make-overlay (car bounds)
+ (if (= (car bounds) (cdr bounds))
+ (1+ (cdr bounds))
+ (cdr bounds))))
(push ov isl--item-overlays)
+ (when (= (car bounds) (cdr bounds))
+ (overlay-put ov 'line-prefix
+ (propertize "$" 'face 'isl-match)))
(overlay-put ov 'isl t)
(overlay-put ov 'pos count)
(overlay-put ov 'face 'isl-match)
(when isl-multi-search-in-line
(isl--highlight-items-in-line (car bounds) (cdr bounds)))
- (cl-incf count)))
+ (cl-incf count))
+ (when (= (car bounds) (cdr bounds)) (forward-line 1)))
(invalid-regexp (setq isl--invalid t) nil))
(setq isl--item-overlays (reverse isl--item-overlays)))
(if (null isl--item-overlays)