kmacro-x

a fork of vifon's kmacro-x
git clone https://git.trogloxene.org/kmacro-x.git
Log | Files | Refs | README | LICENSE

commit 82d10aae9e4ef1bd445667511f6fb6e1ec1a6e3a
parent 76b39862354b2313cd5612adceca33ea60f3f4c6
Author: Wojciech Siewierski <wojciech@siewierski.eu>
Date:   Sun,  5 Mar 2023 17:16:36 +0100

Preserve the region being active across cursors

Diffstat:
Mkmacro-x-mc.el | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/kmacro-x-mc.el b/kmacro-x-mc.el @@ -135,6 +135,13 @@ necessary initialization." ;; have different offsets. (overlay-put ov 'offsets kmacro-x-mc-offsets) + ;; Store whether the region should be active for this + ;; cursor. This allows to properly replicate the + ;; region-sensitive commands such as using `DEL' to delete + ;; the whole region without affecting the `kill-ring' (like + ;; `C-w' would). + (overlay-put ov 'region-active (region-active-p)) + (if prefix ;; Replace the first or last cursor with the new one. (let ((old-cursor (if backwards @@ -188,6 +195,8 @@ See `kmacro-x-mc-mark-next' for the details." (car (overlay-get ov 'offsets)))) (push-mark (+ (overlay-start ov) (cdr (overlay-get ov 'offsets)))) + (when (overlay-get ov 'region-active) + (activate-mark)) (call-last-kbd-macro))) (run-hooks 'kmacro-x-mc-post-apply-hook) (kmacro-x-mc-mode 0))