Function: consult--split-separator

consult--split-separator is a byte-compiled function defined in consult.el.

Signature

(consult--split-separator STR PLIST)

Documentation

Split input STR in async input and filtering part at first separator.

PLIST is the splitter configuration, including the separator.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
(defun consult--split-separator (str plist)
  "Split input STR in async input and filtering part at first separator.
PLIST is the splitter configuration, including the separator."
  (let ((sep (regexp-quote (char-to-string (plist-get plist :separator)))))
    (save-match-data
      (if (string-match (format "^\\([^%s]+\\)\\(%s\\)?" sep sep) str)
          ;; Force update if separator is entered.
          `(,(propertize (match-string 1 str) 'consult--force (match-end 2))
            ,(match-end 0)
            ;; List of highlights
            ,@(and (match-end 2) `((,(match-beginning 2) . ,(match-end 2)))))
        `(,str ,(length str))))))