Function: consult-goto-line

consult-goto-line is an autoloaded, interactive and byte-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

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260926.910/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)))))