aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Dalziel <33435574+tomdl89@users.noreply.github.com>2021-06-14 23:47:36 +0200
committerGitHub <noreply@github.com>2021-06-14 23:47:36 +0200
commit5094271b9a31a2102530699aea9ef387f4b96e0e (patch)
treeed39e3055120092c7240dca0951166c3d514265f
parent2fa0d6fb9d3f8d0a6e3d44b7049a3863584e4cbb (diff)
Fix bug in C-r after evil-change (with specified register) (#1476)
-rw-r--r--evil-commands.el3
-rw-r--r--evil-tests.el7
2 files changed, 8 insertions, 2 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 1688cc0..625ac99 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -1679,7 +1679,8 @@ of the block."
((eq type 'block)
(evil-insert 1 nlines))
(t
- (evil-insert 1)))))
+ (evil-insert 1)))
+ (setq evil-this-register nil)))
(evil-define-operator evil-change-line (beg end type register yank-handler)
"Change to end of line, or change whole line if characterwise visual mode."
diff --git a/evil-tests.el b/evil-tests.el
index 4050f3d..e41cb7a 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -2831,7 +2831,12 @@ word3[]"))
(ert-info ("special register :")
(evil-test-buffer
"[f]oo bar\n"
- (":noh\ni\C-r:"))))
+ (":noh\ni\C-r:")))
+ (ert-info ("Paste from register during change to register")
+ (evil-test-buffer
+ "[a]lpha beta"
+ ("\"ayiw" "w" "\"bciw" "\C-ra")
+ "alpha alpha[]")))
(ert-deftest evil-test-last-insert-register ()
"Test last insertion register."