Function: consult-goto-line

consult-goto-line is an interactive and natively compiled function defined in consult.el.

Signature

(consult-goto-line &optional ARG)

Documentation

Read line number and jump to the line with preview.

Enter either a line number to jump to the first column of the given line or line:column in order to jump to a specific column. Jump directly if a line number is given as prefix ARG. The command respects narrowing and the settings consult-goto-line-numbers and consult-line-numbers-widen.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
;;;###autoload
(defun consult-goto-line (&optional arg)
  "Read line number and jump to the line with preview.

Enter either a line number to jump to the first column of the
given line or line:column in order to jump to a specific column.
Jump directly if a line number is given as prefix ARG.  The
command respects narrowing and the settings
`consult-goto-line-numbers' and `consult-line-numbers-widen'."
  (interactive "P")
  (if arg
      (call-interactively #'goto-line)
    (consult--forbid-minibuffer)
    (consult--local-let ((display-line-numbers consult-goto-line-numbers)
                         (display-line-numbers-widen consult-line-numbers-widen))
      (while (if-let* ((pos (consult--prompt
                             :prompt "Go to line: "
                             :history 'goto-line-history
                             :transform #'consult--goto-line-position
                             :state (consult--jump-preview))))
                 (consult--jump pos)
               t)))))