emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/anzu a36458386d 107/288: Don't show default replacement in


From: ELPA Syncer
Subject: [nongnu] elpa/anzu a36458386d 107/288: Don't show default replacement in prompt
Date: Thu, 6 Jan 2022 03:58:44 -0500 (EST)

branch: elpa/anzu
commit a36458386d2836e9c98dad8b05e0040b71d8ade5
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>

    Don't show default replacement in prompt
    
    It is wrong when replace-at-cursor commands are executed.
---
 anzu.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/anzu.el b/anzu.el
index 55deb774e0..6ef82b2eb4 100644
--- a/anzu.el
+++ b/anzu.el
@@ -272,9 +272,9 @@
           (if use-regexp " regexp" "")
           (if use-region " in region" ""))  )
 
-(defun anzu--query-prompt (use-region use-regexp)
+(defun anzu--query-prompt (use-region use-regexp at-cursor)
   (let ((prompt (anzu--query-prompt-base use-region use-regexp)))
-    (if query-replace-defaults
+    (if (and query-replace-defaults (not at-cursor))
         (format "%s (default %s -> %s) " prompt
                 (query-replace-descr (car query-replace-defaults))
                 (query-replace-descr (cdr query-replace-defaults)))
@@ -519,7 +519,7 @@
          (overlay-limit (anzu--overlay-limit))
          (beg (anzu--region-begin use-region (anzu--begin-thing at-cursor 
thing) backward))
          (end (anzu--region-end use-region thing))
-         (prompt (anzu--query-prompt use-region use-regexp))
+         (prompt (anzu--query-prompt use-region use-regexp at-cursor))
          (delimited (and current-prefix-arg (not (eq current-prefix-arg '-))))
          (curbuf (current-buffer))
          (clear-overlay nil))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]