Skip to content

Commit 9e27bb9

Browse files
committed
No performant delete if range supplied
Fixes #1858
1 parent 59774e3 commit 9e27bb9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

evil-commands.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4212,7 +4212,7 @@ Use `evil-flush-lines' if INVERT is nil, or `evil-keep-lines' if not."
42124212
(when (and pattern command)
42134213
(when evil-ex-search-vim-style-regexp
42144214
(setq pattern (evil-transform-vim-style-regexp pattern)))
4215-
(if (and ex-delete (not (nth 3 command-form)))
4215+
(if (and ex-delete (not (nth 3 command-form)) (not (nth 1 command-form)))
42164216
(evil--ex-performant-global-delete beg end pattern invert)
42174217
(setq isearch-string pattern)
42184218
(isearch-update-ring pattern t)

evil-tests.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8668,6 +8668,11 @@ maybe we need one line more with some text\n")
86688668
"[n]o 1\nno 2\nno 3\nyes 4\nno 5\nno 6\nno 7\n"
86698669
(":g/yes/d2" [return])
86708670
"no 1\nno 2\nno 3\n[n]o 6\nno 7\n"))
8671+
(ert-info ("global delete with range")
8672+
(evil-test-buffer
8673+
"alpha\nbravo\ncharlie\ndelta\ncharlie\necho\ngolf\ncharlie\nhotel"
8674+
(":g/charlie/-1d")
8675+
"alpha\ncharlie\ncharlie\necho\ncharlie\nhotel"))
86718676
(ert-info ("global substitute")
86728677
(evil-test-buffer
86738678
"[n]o 1\nno 2\nno 3\nyes 4\nno 5\nno 6\nno 7\n"

0 commit comments

Comments
 (0)