Function: eca-chat--prompt-block-broken-p

eca-chat--prompt-block-broken-p is a natively compiled function defined in eca-chat.el.

Signature

(eca-chat--prompt-block-broken-p)

Documentation

Return non-nil when the prompt block markup is corrupted.

Checks that the separator, context and prompt overlays exist, that the context line ends before the prompt field starts and that the prompt field starts a line. Edits crossing the block break these invariants (see #305).

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
(defun eca-chat--prompt-block-broken-p ()
  "Return non-nil when the prompt block markup is corrupted.
Checks that the separator, context and prompt overlays exist,
that the context line ends before the prompt field starts and
that the prompt field starts a line.  Edits crossing the block
break these invariants (see #305)."
  (let ((area-ov (eca-chat--prompt-area-ov))
        (context-ov (eca-chat--prompt-context-field-ov))
        (prompt-ov (eca-chat--prompt-field-ov)))
    (or (not (and area-ov context-ov prompt-ov))
        (let ((prompt-start (overlay-start prompt-ov)))
          (or (>= (overlay-end context-ov) prompt-start)
              (not (eq (char-before prompt-start) ?\n)))))))