mirror of
https://github.com/org-roam/org-roam
synced 2025-09-22 16:20:54 -05:00
(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:
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)))))
|
||||
|
||||
|
Reference in New Issue
Block a user