branch: externals/ergoemacs-mode
commit 6a3214e1a892a45f575604f0bc4bb83175142aa4
Merge: 4a6ba06 9a5b97f
Author: Matthew Fidler <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #490 from Valdaer/keep-region-selected-after-ctrl-c
Keep region selected after ctrl c
---
ergoemacs-functions.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 83ffe5c..62669c9 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-mark-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,8 @@ 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
+ (if ergoemacs-keep-region-after-copy
+ (ergoemacs--keep-mark-active)
(deactivate-mark)))
(defun ergoemacs-cut-line-or-region (&optional arg)