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

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

[nongnu] elpa/anzu 48eb310d24 139/288: Improve restoring point when canc


From: ELPA Syncer
Subject: [nongnu] elpa/anzu 48eb310d24 139/288: Improve restoring point when canceling
Date: Thu, 6 Jan 2022 03:58:47 -0500 (EST)

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

    Improve restoring point when canceling
---
 anzu.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/anzu.el b/anzu.el
index 90fd5f98c4..e0919631e7 100644
--- a/anzu.el
+++ b/anzu.el
@@ -579,6 +579,7 @@
 (cl-defun anzu--query-replace-common (use-regexp &key at-cursor thing 
prefix-arg (query t))
   (anzu--cons-mode-line 'replace-query)
   (let* ((use-region (use-region-p))
+         (orig-point (point))
          (backward (anzu--replace-backward-p prefix-arg))
          (overlay-limit (anzu--overlay-limit))
          (beg (anzu--region-begin use-region (anzu--begin-thing at-cursor 
thing) backward))
@@ -610,6 +611,8 @@
       (progn
         (unless clear-overlay
           (anzu--clear-overlays curbuf beg end))
+        (when (zerop anzu--current-posion)
+          (goto-char orig-point))
         (anzu--reset-mode-line)
         (force-mode-line-update)))))
 



reply via email to

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