[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ce51607 6/7: Allow to cancel "M-q" with "C-g"
From: |
Oleh Krehel |
Subject: |
[elpa] master ce51607 6/7: Allow to cancel "M-q" with "C-g" |
Date: |
Thu, 26 Mar 2015 11:30:32 +0000 |
branch: master
commit ce516073e5e4359b88f98610bae9b157945eb8e8
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow to cancel "M-q" with "C-g"
swiper.el (swiper-query-replace): If the TO argument to
`perform-replace' isn't read, don't exit minibuffer.
If the user called `swiper-query-replace' and isn't happy with the
current input being the FROM arg of `perform-replace', it's possible to
cancel with "C-g", and edit the input once again.
---
swiper.el | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/swiper.el b/swiper.el
index a57004f..cb8e91b 100644
--- a/swiper.el
+++ b/swiper.el
@@ -83,16 +83,15 @@
(interactive)
(if (null (window-minibuffer-p))
(user-error "Should only be called in the minibuffer through
`swiper-map'")
- (delete-minibuffer-contents)
- (setq ivy--action
- (lambda ()
- (let ((from (ivy--regex ivy-text)))
- (perform-replace
- from
- (query-replace-read-to from "Query replace" t)
- t t t))))
- (swiper--cleanup)
- (exit-minibuffer)))
+ (let* ((from (ivy--regex ivy-text))
+ (to (query-replace-read-to from "Query replace" t)))
+ (delete-minibuffer-contents)
+ (setq ivy--action
+ (lambda ()
+ (perform-replace from to
+ t t t)))
+ (swiper--cleanup)
+ (exit-minibuffer))))
(defvar swiper--window nil
"Store the current window.")
- [elpa] master updated (90473ac -> 0c2da66), Oleh Krehel, 2015/03/26
- [elpa] master 2ae5b9c 3/7: swiper.el (swiper-font-lock-ensure): Ignore gnus modes, Oleh Krehel, 2015/03/26
- [elpa] master abb6e0b 5/7: swiper.el (swiper-query-replace): Call only in minibuffer, Oleh Krehel, 2015/03/26
- [elpa] master 764e003 1/7: swiper.el (swiper-font-lock-ensure): Omit erc-mode, Oleh Krehel, 2015/03/26
- [elpa] master fdb0c45 4/7: Add swiper-query-replace, Oleh Krehel, 2015/03/26
- [elpa] master d63ce8f 2/7: Ensure that inserted candidates don't have read-only property, Oleh Krehel, 2015/03/26
- [elpa] master 0c2da66 7/7: Merge commit 'ce516073e5e4359b88f98610bae9b157945eb8e8' from swiper, Oleh Krehel, 2015/03/26
- [elpa] master ce51607 6/7: Allow to cancel "M-q" with "C-g",
Oleh Krehel <=