aboutsummaryrefslogtreecommitdiff
path: root/evil-tests.el
diff options
context:
space:
mode:
authorAxel Forsman <axelsfor@gmail.com>2023-02-09 22:14:57 +0100
committerAxel Forsman <axelsfor@gmail.com>2023-02-20 19:05:23 +0100
commit22d76a4080e40381aae194c94f3bc16ba67a330a (patch)
tree5cbb2de1d3c522cd16e610d884d745a60cf1775f /evil-tests.el
parent2ce03d412c4e93b0b89eb43d796c991806415b8a (diff)
Restore match data after eval:ing replacement
This fixes #1481. Also pass along the number of the current replacement to function called to generate each replacement, which fixes #1411.
Diffstat (limited to 'evil-tests.el')
-rw-r--r--evil-tests.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/evil-tests.el b/evil-tests.el
index ebb673b..1940333 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -7849,7 +7849,15 @@ golf h[o]>tel")))
(evil-test-buffer
"[f]oo"
(":s/foo")
- "")))
+ ""))
+ (ert-info ("Use replace count in substitution")
+ (evil-test-buffer "xx"
+ (":s/./\\#/g")
+ "01"))
+ (ert-info ("Substitute with `calc' Lisp expression")
+ (evil-test-buffer "1 + 2"
+ (":s/.*/\\,(calc-eval \\0)")
+ "3")))
(ert-deftest evil-test-ex-repeat-substitute-replacement ()
"Test `evil-ex-substitute' with repeating of previous substitutions."