0

I am experimenting with custom helm sources, but I cannot figure out how to get fuzzy completion to work with it. Here is an example:

(defun my-helm-test()
  (interactive)
  (let ((some-helm-source
         '((name . "my helm test")
           (candidates . ("abc xyz" "age hgi" "afg ggg" "ahh iii"))
           (fuzzy-match . t)
           (action . (lambda (candidate)
                    (message-box "%s" candidate))))))
         (helm :sources some-helm-source)))

When I type a followed by SPACE followed by x in the helm window, I was hoping to be able to select the "abc xyz" candidate. Instead, once I type SPACE no candidates are left.

Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51

1 Answers1

0

Seems like helm did not recognize the fuzzy-match attribute in my source for some reason. I solved this by using helm-build-sync-source instead of creating a custom source:

(defun my-helm-test()
  (interactive)
  (helm :sources
        (helm-build-sync-source "my helm test"
          :candidates '("abc xyz" "age hgi" "afg ggg" "ahh iii")
          :action (lambda (candidate)
                      (message-box "%s" candidate)))))

Now fuzzy matching works as expected.

Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51