Skip to content

Commit

Permalink
Fix searching for literal < and > with very-magic
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed May 17, 2023
1 parent 1379ab4 commit 6e22e2b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions evil-search.el
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions evil-tests.el
Expand Up @@ -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"
Expand Down

0 comments on commit 6e22e2b

Please sign in to comment.