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

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

[nongnu] elpa/helm 586ab19df2 4/5: Honor delete-active-region when delet


From: ELPA Syncer
Subject: [nongnu] elpa/helm 586ab19df2 4/5: Honor delete-active-region when deleting char backward (#2675)
Date: Thu, 4 Jul 2024 10:00:20 -0400 (EDT)

branch: elpa/helm
commit 586ab19df24b62bc6e8309aafa682505897d6f7c
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Honor delete-active-region when deleting char backward (#2675)
---
 helm-core.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/helm-core.el b/helm-core.el
index 964fa17f53..ae1a2a1c79 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -4079,7 +4079,14 @@ Update is reenabled when idle 1s."
   "Delete char backward and update when reaching prompt."
   (interactive "p")
   (condition-case _err
-      (delete-char (- arg))
+      (cond ((and (use-region-p)
+                  delete-active-region
+                  (= arg 1))
+             ;; If a region is active, kill or delete it.
+             (if (eq delete-active-region 'kill)
+                 (kill-region (region-beginning) (region-end) 'region)
+               (delete-region (region-beginning) (region-end))))
+            (t (delete-char (- arg))))
     (buffer-read-only
      (progn
        (helm-update)



reply via email to

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