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

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

[elpa] externals/ergoemacs-mode fad3ed1 56/87: Fixed not removing visibl


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode fad3ed1 56/87: Fixed not removing visible selection when ergoemacs-keep-region-after-copy is set to true.
Date: Wed, 14 Apr 2021 18:47:07 -0400 (EDT)

branch: externals/ergoemacs-mode
commit fad3ed1602230cf68844e48f9d96c8f1d4910b19
Author: Sławomir Wójcik <valdaer@gmail.com>
Commit: Sławomir Wójcik <valdaer@gmail.com>

    Fixed not removing visible selection when ergoemacs-keep-region-after-copy 
is set to true.
---
 ergoemacs-functions.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 83ffe5c..a275253 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -404,6 +404,11 @@ If `narrow-to-region' is in effect, then cut that region 
only."
   :type 'boolean
   :group 'ergoemacs-mode)
 
+(defun ergoemacs--keep-active ()
+  (when (mark t)
+    (setq mark-active t
+          deactivate-mark nil)))
+
 (defun ergoemacs-copy-line-or-region (&optional arg)
   "Copy current line, or current text selection.
 Pass prefix ARG to the respective copy functions."
@@ -434,7 +439,10 @@ Pass prefix ARG to the respective copy functions."
            (call-interactively 'move-end-of-line)))
        (re-search-forward "\\=\n" nil t) ;; Include newline
        (point)))))
-  (unless ergoemacs-keep-region-after-copy
+  ;; (unless ergoemacs-keep-region-after-copy
+  ;;  (deactivate-mark)))
+  (if ergoemacs-keep-region-after-copy
+      (ergoemacs--keep-active)
     (deactivate-mark)))
 
 (defun ergoemacs-cut-line-or-region (&optional arg)



reply via email to

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