Function: consult--async-min-input

consult--async-min-input is a byte-compiled function defined in consult.el.

Signature

(consult--async-min-input &optional MIN-INPUT)

Documentation

Async function enforcing a minimum input length.

MIN-INPUT is the minimum input length and defaults to consult-async-min-input.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
(defun consult--async-min-input (&optional min-input)
  "Async function enforcing a minimum input length.
MIN-INPUT is the minimum input length and defaults to
`consult-async-min-input'."
  (setq min-input (or min-input consult-async-min-input))
  (lambda (sink)
    (lambda (action)
      (if (stringp action)
          ;; Input can be marked with the `consult--force' property such that it
          ;; is passed through in any case.
          (funcall sink (if (or (and (not (equal action ""))
                                     (get-text-property 0 'consult--force action))
                                (>= (length action) min-input))
                            action 'cancel))
        (funcall sink action)))))