From fc4eff49550eef24b935486ecfb11a86a5fe43e8 Mon Sep 17 00:00:00 2001 From: Frank Fischer Date: Sun, 6 Mar 2016 19:00:17 +0100 Subject: Preserve visual region in `evil-move` (re #630) After calling `evil-move` the visual region should be adjusted so that it covers the moved lines in their new position. --- evil-commands.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evil-commands.el b/evil-commands.el index 3a14fdc..6247fb1 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -1419,8 +1419,12 @@ of the block." (when (or (zerop len) (/= (aref txt (1- len)) ?\n)) (setq txt (concat txt "\n"))) (when (and (eobp) (not (bolp))) (newline)) ; incomplete last line + (when (evil-visual-state-p) + (move-marker evil-visual-mark (point))) (insert txt) - (forward-line -1))) + (forward-line -1) + (when (evil-visual-state-p) + (move-marker evil-visual-point (point))))) (evil-define-operator evil-substitute (beg end type register) "Change a character." -- cgit v1.0