[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c9f1889 136/184: swiper.el (swiper--query-replace-setup):
From: |
Oleh Krehel |
Subject: |
[elpa] master c9f1889 136/184: swiper.el (swiper--query-replace-setup): Fix "^$" issue |
Date: |
Wed, 16 Oct 2019 13:15:09 -0400 (EDT) |
branch: master
commit c9f18892cec4dbaa04f3b4e0f7dd3497de0be257
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--query-replace-setup): Fix "^$" issue
When the match length is 0, `forward-char' so that the while loop is
not stuck.
Fixes #2232
---
swiper.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/swiper.el b/swiper.el
index 11c4bce..08afea2 100644
--- a/swiper.el
+++ b/swiper.el
@@ -170,8 +170,9 @@ Treated as non-nil when searching backwards."
(let ((end (window-end (selected-window) t))
(re (ivy--regex ivy-text)))
(save-excursion
- (goto-char (window-start))
- (while (re-search-forward re end t)
+ (beginning-of-line)
+ (while (and (re-search-forward re end t)
+ (not (eobp)))
(let ((ov (make-overlay (1- (match-end 0)) (match-end 0)))
(md (match-data)))
(overlay-put
@@ -180,7 +181,9 @@ Treated as non-nil when searching backwards."
(lambda (x)
(list `(match-string ,x) (match-string x)))
(number-sequence 0 (1- (/ (length md) 2)))))
- (push ov swiper--query-replace-overlays)))))))
+ (push ov swiper--query-replace-overlays))
+ (unless (> (match-end 0) (match-beginning 0))
+ (forward-char)))))))
(defun swiper-query-replace ()
"Start `query-replace' with string to replace from last search string."
- [elpa] master 46db1b9 107/184: counsel.el (counsel-mark-ring): Add customize variable to sort or not, (continued)
- [elpa] master 46db1b9 107/184: counsel.el (counsel-mark-ring): Add customize variable to sort or not, Oleh Krehel, 2019/10/16
- [elpa] master c0aa563 112/184: ivy.el (ivy-occur): Set up next-error-function, Oleh Krehel, 2019/10/16
- [elpa] master 1a74a21 110/184: ivy-occur: setup for next-error., Oleh Krehel, 2019/10/16
- [elpa] master 30adc93 115/184: Add actions to counsel-switch-buffer, Oleh Krehel, 2019/10/16
- [elpa] master 892e44a 079/184: doc: Add full text of licences, Oleh Krehel, 2019/10/16
- [elpa] master 4645e89 121/184: swiper.el (swiper-action-copy): Add and bind to "M-o w", Oleh Krehel, 2019/10/16
- [elpa] master 77997ea 120/184: counsel.el (counsel-M-x-transformer): Handle read-only strings, Oleh Krehel, 2019/10/16
- [elpa] master 1984068 122/184: doc/ivy.org: Update GFDL license to no Invariant Sections, Oleh Krehel, 2019/10/16
- [elpa] master 881cbc5 130/184: counsel.el (counsel-google-function): Use request in async mode, Oleh Krehel, 2019/10/16
- [elpa] master b39f383 125/184: counsel.el (counsel-git-grep-occur): Re-use counsel-grep-like-occur, Oleh Krehel, 2019/10/16
- [elpa] master c9f1889 136/184: swiper.el (swiper--query-replace-setup): Fix "^$" issue,
Oleh Krehel <=
- [elpa] master b9bb7c6 140/184: ivy.el (ivy-configure): New function to configure many things at once, Oleh Krehel, 2019/10/16
- [elpa] master e3dabec 143/184: counsel.el: Use ivy-configure :unwind-fn, Oleh Krehel, 2019/10/16
- [elpa] master f16ac0e 148/184: ivy.el (ivy--format): Set case-fold-search, Oleh Krehel, 2019/10/16
- [elpa] master 501ac71 151/184: ivy.el (ivy-occur-revert-buffer): Re-use ivy-highlight-grep-commands, Oleh Krehel, 2019/10/16
- [elpa] master 6b0c41b 167/184: ivy.el (ivy-sort-file-function-using-ido): Make obsolete, Oleh Krehel, 2019/10/16
- [elpa] master 22cc602 160/184: counsel.el (counsel-find-symbol): Should not show up in counsel-M-x, Oleh Krehel, 2019/10/16
- [elpa] master b85f857 166/184: .github/FUNDING.yml: Add github, Oleh Krehel, 2019/10/16
- [elpa] master 722250c 162/184: counsel.el (counsel-imenu-action): Handle nil case, Oleh Krehel, 2019/10/16
- [elpa] master 9970ae6 180/184: counsel.el (counsel-read-directory-name): Add, Oleh Krehel, 2019/10/16
- [elpa] master 7054901 176/184: ivy.el (ivy-occur-revert-buffer): Make more generic, Oleh Krehel, 2019/10/16