mirror of
https://github.com/org-roam/org-roam
synced 2025-09-24 16:30:55 -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)))))
|
nil)))))
|
||||||
|
|
||||||
;;; Completion at point
|
;;; 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
|
(defconst org-roam-fuzzy-link-regexp
|
||||||
(rx (seq "[["
|
(rx (seq "[["
|
||||||
(group
|
(group
|
||||||
@@ -1160,7 +1165,10 @@ This function hooks into `org-open-at-point' via
|
|||||||
(if (functionp collection)
|
(if (functionp collection)
|
||||||
(completion-table-dynamic
|
(completion-table-dynamic
|
||||||
(lambda (_)
|
(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)
|
collection)
|
||||||
:exit-function exit-fn)))))
|
:exit-function exit-fn)))))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user