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

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

[elpa] externals/pyim c845da74e1: pyim-isearch-mode: 对包含 \ 的搜索字符串特殊处理。


From: ELPA Syncer
Subject: [elpa] externals/pyim c845da74e1: pyim-isearch-mode: 对包含 \ 的搜索字符串特殊处理。
Date: Tue, 6 Sep 2022 22:58:00 -0400 (EDT)

branch: externals/pyim
commit c845da74e1733b1fd3760306b02486280c9b1319
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    pyim-isearch-mode: 对包含 \ 的搜索字符串特殊处理。
---
 pyim-cregexp-utils.el | 7 ++++++-
 pyim-cregexp.el       | 1 -
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pyim-cregexp-utils.el b/pyim-cregexp-utils.el
index 4d22885a59..017664b1e1 100644
--- a/pyim-cregexp-utils.el
+++ b/pyim-cregexp-utils.el
@@ -103,7 +103,12 @@ buffer."
         (funcall (if ,isearch-forward
                      're-search-forward
                    're-search-backward)
-                 (pyim-cregexp-build string) bound noerror count)))))
+                 ;; FIXME: 搜索字符串中的 '\' 不太好处理,如果遇到, 目前的做法是
+                 ;; 不做任何处理,这个是需要改进的地方。
+                 (if (string-match-p "\\\\" string)
+                     (regexp-quote string)
+                   (pyim-cregexp-build string))
+                 bound noerror count)))))
 
 ;; 让 ivy 支持 code 搜索。
 (declare-function ivy--regex-plus "ivy")
diff --git a/pyim-cregexp.el b/pyim-cregexp.el
index 74205e0a2a..bd40e38216 100644
--- a/pyim-cregexp.el
+++ b/pyim-cregexp.el
@@ -142,7 +142,6 @@ regexp, 所以搜索单字的时候一般可以搜到生僻字,但搜索句子
                 (xr (pyim-cregexp--create-cregexp-from-string
                      x scheme char-level-num chinese-only))
               x))
-          ;; FIXME: (xr "ni\\hao") 结果应该是 ni\\hao, 但实际是 nihao.
           (xr string))))
       string))
 



reply via email to

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