aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--evil-commands.el2
-rw-r--r--evil-tests.el5
2 files changed, 6 insertions, 1 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 286cf94..3404805 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -4212,7 +4212,7 @@ Use `evil-flush-lines' if INVERT is nil, or `evil-keep-lines' if not."
(when (and pattern command)
(when evil-ex-search-vim-style-regexp
(setq pattern (evil-transform-vim-style-regexp pattern)))
- (if (and ex-delete (not (nth 3 command-form)))
+ (if (and ex-delete (not (nth 3 command-form)) (not (nth 1 command-form)))
(evil--ex-performant-global-delete beg end pattern invert)
(setq isearch-string pattern)
(isearch-update-ring pattern t)
diff --git a/evil-tests.el b/evil-tests.el
index 09569f1..8dfaf1d 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -8668,6 +8668,11 @@ maybe we need one line more with some text\n")
"[n]o 1\nno 2\nno 3\nyes 4\nno 5\nno 6\nno 7\n"
(":g/yes/d2" [return])
"no 1\nno 2\nno 3\n[n]o 6\nno 7\n"))
+ (ert-info ("global delete with range")
+ (evil-test-buffer
+ "alpha\nbravo\ncharlie\ndelta\ncharlie\necho\ngolf\ncharlie\nhotel"
+ (":g/charlie/-1d")
+ "alpha\ncharlie\ncharlie\necho\ncharlie\nhotel"))
(ert-info ("global substitute")
(evil-test-buffer
"[n]o 1\nno 2\nno 3\nyes 4\nno 5\nno 6\nno 7\n"