(feat): add case sensitivity for Org-roam completions (#1056)
Completions are now case-insensitive by default. `org-roam-completion-case-sensitive` can be set to `t` to allow case-sensitive completions.
This commit is contained in:
parent
4e5b52fbd3
commit
38234b491d
1 changed files with 9 additions and 1 deletions
10
org-roam.el
10
org-roam.el
|
@ -1112,6 +1112,11 @@ This function hooks into `org-open-at-point' via
|
|||
nil)))))
|
||||
|
||||
;;; Completion at point
|
||||
(defcustom org-roam-completion-case-sensitive nil
|
||||
"If t, completions for Org-roam become case sensitive."
|
||||
:group 'org-roam
|
||||
:type 'boolean)
|
||||
|
||||
(defconst org-roam-fuzzy-link-regexp
|
||||
(rx (seq "[["
|
||||
(group
|
||||
|
@ -1160,7 +1165,10 @@ This function hooks into `org-open-at-point' via
|
|||
(if (functionp collection)
|
||||
(completion-table-dynamic
|
||||
(lambda (_)
|
||||
(cl-remove-if (apply-partially 'string= prefix) (funcall collection))))
|
||||
(cl-remove-if (if org-roam-completion-case-sensitive
|
||||
(apply-partially 'string= prefix)
|
||||
(lambda (s) (string-collate-equalp prefix s nil t)))
|
||||
(funcall collection))))
|
||||
collection)
|
||||
:exit-function exit-fn)))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue