branch: externals/consult-hoogle
commit ef5d4b27acf006d3f7c40673817d2dade4d383ca
Author: Rahguzar <[email protected]>
Commit: Rahguzar <[email protected]>
Fix #6: Handle the case of a no results string
---
consult-hoogle.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/consult-hoogle.el b/consult-hoogle.el
index 9c19892966..03c83245db 100644
--- a/consult-hoogle.el
+++ b/consult-hoogle.el
@@ -100,6 +100,13 @@ we use the same buffer throughout."
'font-lock-preprocessor-face))))
'consult--candidate parsed))))
+(defun consult-hoogle--format (lines)
+ "Format candidates using LINES."
+ (let (candidates)
+ (dolist (line lines)
+ (push (consult-hoogle--format-result line) candidates))
+ (delq nil candidates)))
+
;;;; Constructing the details buffer for the selected result
(defun consult-hoogle--show-details (action cand)
"Show the details for the current CAND and handle ACTION."
@@ -150,10 +157,9 @@ we use the same buffer throughout."
(get-text-property 0 'consult--candidate candidate)))
(defalias 'consult-hoogle--source
- (consult--async-pipeline
- (consult--async-process #'consult-hoogle--builder)
- (consult--async-map #'consult-hoogle--format-result)
- (consult--async-highlight #'consult-hoogle--builder))
+ (consult--process-collection #'consult-hoogle--builder
+ :transform (consult--async-transform #'consult-hoogle--format)
+ :highlight t)
"Async consult source to obtain search results from hoogle.")
(defun consult-hoogle--search (&optional state action)