Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No performant delete if range supplied #1859

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion evil-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions evil-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading