diff --git a/modules/editor/siren-fussy.el b/modules/editor/siren-fussy.el index 55af804..2cf7d0f 100644 --- a/modules/editor/siren-fussy.el +++ b/modules/editor/siren-fussy.el @@ -18,7 +18,21 @@ (use-package flx-rs :straight (flx-rs :repo "jcs-elpa/flx-rs" :fetcher github :files (:defaults "bin")) + :preface + (defun siren-flx-rs-score-consult-buffer-fix (orig-fun str query &rest args) + "Fix input string provided by consult-buffer to be compatible with flx-rs. + +Consult buffer adds some extra bytes at the end of input +candidates which causes flx-rs to not match some inputs +correctly. This function will attempt to extract buffer name from +text properties added by consult-buffer, or fallback on the input +string as provided." + (let* ((props (text-properties-at 0 str)) + (buffer (if props (alist-get 'buffer props)))) + (apply orig-fun (or buffer str) query args))) + :config + (advice-add 'flx-rs-score :around 'siren-flx-rs-score-consult-buffer-fix) (flx-rs-load-dyn)) (use-package fussy