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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.