Skip to content

Commit

Permalink
Add list of functions that can handle whitespace (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
jojojames committed Dec 2, 2024
1 parent 1ef3440 commit 5c81656
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fussy.el
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ This may or may not be used by `fussy-score-ALL-fn'."
(function :tag "Custom function"))
:group 'fussy)

(defcustom fussy-whitespace-ok-fns '(fussy-fzf-native-score)
"List of `fussy-score-fn's that can accept whitespace."
:type '(list function)
:group 'fussy)

(defcustom fussy-score-ALL-fn 'fussy-score
"Function used for score ALL candidates.
Expand Down Expand Up @@ -675,9 +680,9 @@ Set a text-property \='completion-score on candidates with their score.
(push x result))
(let ((score (funcall fussy-score-fn
x
(if (fussy--orderless-p)
(replace-regexp-in-string "\\\s" "" string)
string)
(if (memq fussy-score-fn fussy-whitespace-ok-fns)
string
(replace-regexp-in-string "\\\s" "" string))
cache)))
;; (message
;; (format "fn: %S candidate: %s query: %s score %S"
Expand Down

0 comments on commit 5c81656

Please sign in to comment.