Function: eca-completion--inserted-next-overlay-char-p

eca-completion--inserted-next-overlay-char-p is a natively compiled function defined in eca-completion.el.

Signature

(eca-completion--inserted-next-overlay-char-p COMMAND)

Documentation

Handle the case where the char just inserted is the start of the completion.

If so, update the overlays and continue. COMMAND is the command that triggered in post-command-hook.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-completion.el
(defun eca-completion--inserted-next-overlay-char-p (command)
  "Handle the case where the char just inserted is the start of the completion.
If so, update the overlays and continue.  COMMAND is the command that triggered
in `post-command-hook'."
  (when (and (symbolp this-command)
             (eq command 'self-insert-command)
             (eca-completion--overlay-visible))
    (let* ((ov eca-completion--overlay)
           (completion (overlay-get ov 'completion)))
      ;; The char just inserted is the next char of completion
      (when (eq last-command-event (elt completion 0))
        (if (= (length completion) 1)
            ;; If there is only one char in the completion, accept it
            (eca-completion-accept)
          (eca-completion--set-overlay-text ov (substring completion 1)))))))