emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil 1d37abaa9e: Improve case handling for :match


From: ELPA Syncer
Subject: [nongnu] elpa/evil 1d37abaa9e: Improve case handling for :match
Date: Thu, 8 Jun 2023 19:00:51 -0400 (EDT)

branch: elpa/evil
commit 1d37abaa9e9da89c6e9461804595e338b5ef3585
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>

    Improve case handling for :match
---
 evil-commands.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/evil-commands.el b/evil-commands.el
index ab4ad2cf37..50b3c4f058 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -4229,16 +4229,21 @@ Unlike vim, multiple highlights can be set at once, so 
there is no need for
     (cl-destructuring-bind (_ _ fs fe ss se) (match-data)
       (let* ((face (unless (= fs fe) (substring args fs fe)))
              (search-string (unless (= ss se) (substring args ss se)))
-             (patterns (evil-delimited-arguments (or search-string face "")))
-             (pattern (if (and (car patterns) evil-ex-search-vim-style-regexp)
-                          (evil-transform-vim-style-regexp (car patterns))
-                        (car patterns))))
+             (raw-patterns (evil-delimited-arguments (or search-string face 
"")))
+             (raw-pattern (or (car raw-patterns) ""))
+             (case-fold-search ;; ignore case if non-nil
+              (eq (evil-ex-regex-case raw-pattern evil-ex-search-case) 
'insensitive))
+             (search-upper-case nil) ;; bypass isearch-no-upper-case-p
+             (pattern-no-case (evil-ex-regex-without-case raw-pattern))
+             (pattern (if evil-ex-search-vim-style-regexp
+                          (evil-transform-vim-style-regexp pattern-no-case)
+                        pattern-no-case)))
         (cond
          ((or (not face) (string= "none" face))
           (if bang
               (hi-lock-unface-buffer t)
             (call-interactively #'hi-lock-unface-buffer)))
-         ((/= 1 (length patterns))
+         ((/= 1 (length raw-patterns))
           (user-error "Invalid pattern argument supplied"))
          ((not search-string)
           (hi-lock-face-buffer pattern (hi-lock-read-face-name)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]