aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Dalziel <tom_dl@hotmail.com>2023-05-17 11:25:45 +0100
committerTom Dalziel <33435574+tomdl89@users.noreply.github.com>2023-05-17 13:05:45 +0200
commit6e22e2b7f353f16df5e117ab220d89c0450b44b9 (patch)
tree3a5f5d8ecf1de712664466f800e44e0d978ad6a9
parent1379ab42c4090b2c677381b3911fec7ede47a4ad (diff)
Fix searching for literal < and > with very-magic
-rw-r--r--evil-search.el4
-rw-r--r--evil-tests.el14
2 files changed, 16 insertions, 2 deletions
diff --git a/evil-search.el b/evil-search.el
index b42d924..e26325c 100644
--- a/evil-search.el
+++ b/evil-search.el
@@ -435,8 +435,8 @@ expression and is not transformed."
;; possibly transform regular expression from vim-style to
;; Emacs-style.
(if (and evil-ex-search-vim-style-regexp
- (not (or (string-match-p "\\`\\\\_?<" regexp)
- (string-match-p "\\\\_?>\\'" regexp))))
+ (not (or (string-match-p "\\`\\\\_<" regexp)
+ (string-match-p "\\\\_>\\'" regexp))))
(setq re (evil-transform-vim-style-regexp re))
;; Even for Emacs regular expressions we translate certain
;; whitespace sequences
diff --git a/evil-tests.el b/evil-tests.el
index fbf1cd4..e9ca224 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -8056,6 +8056,20 @@ golf h[o]>tel")))
"start\nline 2\nline [3]\n\n"
("n")
"start\nline 2\nline 3\n[]\n"))
+ (ert-info ("Can search for start/end of symbol")
+ (let ((evil-magic 'very-magic))
+ (evil-test-buffer
+ "[a]lpha bravo bra charlie"
+ ("/bra\\_>" [return])
+ "alpha bravo [b]ra charlie")))
+ (ert-info ("Can search for literal < and >")
+ (let ((evil-magic 'very-magic))
+ (evil-test-buffer
+ :visual-start "«"
+ :visual-end "»"
+ "[a]lpha bravo <bravo> charlie"
+ ("/<bravo>" [return])
+ "alpha bravo [<]bravo> charlie")))
(ert-info ("Can paste from register in ex-search")
(evil-test-buffer
"Alpha [b]ravo charlie alpha bravo delta bravo delta"