Function: eca-chat-inline--scroll-or-fallback

eca-chat-inline--scroll-or-fallback is a natively compiled function defined in eca-chat-inline.el.

Signature

(eca-chat-inline--scroll-or-fallback DELTA)

Documentation

Scroll the buffer's inline viewport by DELTA lines.

When there is nothing to scroll, run whatever the pressed key is bound to outside eca-chat-inline--viewport-mode(var)/eca-chat-inline--viewport-mode(fun) (e.g. the usual scroll-other-window), so the keys stay useful.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat-inline.el
(defun eca-chat-inline--scroll-or-fallback (delta)
  "Scroll the buffer's inline viewport by DELTA lines.
When there is nothing to scroll, run whatever the pressed key is
bound to outside `eca-chat-inline--viewport-mode' (e.g. the usual
`scroll-other-window'), so the keys stay useful."
  (let ((ov (eca-chat-inline--buffer-overlay)))
    (unless ov
      ;; Stale mode left by an overlay that evaporated: self-heal.
      (eca-chat-inline--viewport-mode -1))
    (if (and ov
             (not eca-chat-inline--overlays-hidden)
             (integerp eca-chat-inline-max-lines)
             (> (or (overlay-get ov 'eca-chat-inline--body-lines) 0)
                eca-chat-inline-max-lines))
        (eca-chat-inline--scroll-viewport ov delta)
      (let ((fallback (eca-chat-inline--fallback-command)))
        (if (and fallback (not (eq fallback this-command)))
            (call-interactively fallback)
          (user-error "Nothing to scroll"))))))