Skip to content

Commit

Permalink
FIX attribute API use.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambrevar committed Jun 12, 2023
1 parent 32f3a3f commit b46483e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/prompt-buffer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,15 @@ See also `show-prompt-buffer'."
;; critical.
(if dynamic-p
(loop with suggestions = (prompter:suggestions source)
with attributes = (mapcar (rcurry #'prompter:active-attributes :source source) suggestions)
with suggestions-attributes = (mapcar (rcurry #'prompter:active-attributes :source source) suggestions)
for key in (prompter:active-attributes-keys source)
;; REVIEW: A `prompter' function to retrieve attributes by key would be nice.
for width
= (funcall width-function (mapcar #'prompter:attribute-value
(remove key attributes :test 'string/= :key #'prompter:attribute-key)))
= (funcall width-function (mapcar (lambda (attributes)
(prompter:attribute-value
(find key attributes :test 'string=
:key #'prompter:attribute-key)))
suggestions-attributes))
collect width into widths
finally (return (clip-extremes (width-normalization widths))))
(sera:and-let* ((suggestions (prompter:suggestions source))
Expand Down

0 comments on commit b46483e

Please sign in to comment.