Function: evil--ex-print

evil--ex-print is a byte-compiled function defined in evil-commands.el.

Signature

(evil--ex-print BEG END COUNT &optional LINUMP BORDERLINE)

Documentation

Print lines in range to the minibuffer.

Starting at BEG and ending at END + COUNT lines. Include line number at the start of each line if LINUMP is non-nil. Surround line denoted by BORDERLINE with dashes if non-nil.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(defun evil--ex-print (beg end count &optional linump borderline)
  "Print lines in range to the minibuffer.
Starting at BEG and ending at END + COUNT lines.
Include line number at the start of each line if LINUMP is non-nil.
Surround line denoted by BORDERLINE with dashes if non-nil."
  (let* ((count (cond ((stringp count) (string-to-number count))
                      ((natnump count) count)
                      (t 1)))
         (end (save-excursion (goto-char (if (= (point-max) end) end (1- end)))
                              (line-end-position count)))
         (substring (evil--ex-string-for-print beg end linump borderline)))
    (cond ((> 1 count) (user-error "Positive count required"))
          (evil--ex-global-active-p
           (setq evil--ex-print-accumulator
                 (if (string= "" evil--ex-print-accumulator)
                     (concat evil--ex-print-accumulator substring)
                   (concat evil--ex-print-accumulator "\n" substring))))
          (t (evil--ex-print-to-minibuffer substring)
             (when (string-match-p "\n" substring)
               (goto-char end)
               (evil-beginning-of-line))))))