Skip to content

Commit

Permalink
use pinyin text search in org buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Feb 8, 2024
1 parent d004f94 commit 704432b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lisp/init-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,12 @@ Copied from 3rd party package evil-textobj."

;; If the first character of input in ivy is ":" or ";",
;; remaining input is converted into Chinese pinyin regex.
((string-match "[:\|;]" (substring str 0 1))
((or (and (string-match "[:\|;]" (substring str 0 1))
(setq str (substring str 1 len)))
(and (buffer-name) (or (string= "*Org Agenda*" (buffer-name))
(string-match "\\.org$" (buffer-name)))))
(my-ensure 'pinyinlib)
(setq str (pinyinlib-build-regexp-string (substring str 1 len))))
(setq str (pinyinlib-build-regexp-string str)))

;; If the first character of input in ivy is "/",
;; remaining input is converted to pattern to search camel case word
Expand Down

0 comments on commit 704432b

Please sign in to comment.