[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil fd0644ebfc: Allow vim-style regexp for :global comman
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil fd0644ebfc: Allow vim-style regexp for :global command |
Date: |
Fri, 15 Apr 2022 11:58:01 -0400 (EDT) |
branch: elpa/evil
commit fd0644ebfc7e827ea790a7b8fb6c590aada6b225
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
Allow vim-style regexp for :global command
---
evil-commands.el | 2 ++
evil-tests.el | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/evil-commands.el b/evil-commands.el
index ad57b22010..94b1ba7f33 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -3992,6 +3992,8 @@ This is the same as :%s//~/&"
(deactivate-mark deactivate-mark)
match markers)
(when (and pattern command)
+ (when evil-ex-search-vim-style-regexp
+ (setq pattern (evil-transform-vim-style-regexp pattern)))
(setq isearch-string pattern)
(isearch-update-ring pattern t)
(goto-char beg)
diff --git a/evil-tests.el b/evil-tests.el
index 028a10560c..65fd8f4fd2 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -8269,7 +8269,13 @@ maybe we need one line more with some text\n")
(evil-test-buffer
"this\nThis\n"
(":g/This/d" [return])
- "this\n")))))
+ "this\n"))))
+ (ert-info (":global should transform vim-style regexp when appropriate")
+ (let ((evil-ex-search-vim-style-regexp t))
+ (evil-test-buffer
+ "a\n1\nb\n2\nc\n3\n"
+ (":g/\\d/>")
+ "a\n 1\nb\n 2\nc\n 3\n"))))
(ert-deftest evil-test-normal ()
"Test `evil-ex-normal'."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/evil fd0644ebfc: Allow vim-style regexp for :global command,
ELPA Syncer <=