Function: avy--line-cands

avy--line-cands is a byte-compiled function defined in avy.el.

Signature

(avy--line-cands &optional ARG BEG END BOTTOM-UP)

Documentation

Get candidates for selecting a line.

The window scope is determined by avy-all-windows. When ARG is non-nil, do the opposite of avy-all-windows. BEG and END narrow the scope where candidates are searched. When BOTTOM-UP is non-nil, display avy candidates from top to bottom

Source Code

;; Defined in ~/.emacs.d/elpa/avy-20241101.1357/avy.el
(defun avy--line-cands (&optional arg beg end bottom-up)
  "Get candidates for selecting a line.
The window scope is determined by `avy-all-windows'.
When ARG is non-nil, do the opposite of `avy-all-windows'.
BEG and END narrow the scope where candidates are searched.
When BOTTOM-UP is non-nil, display avy candidates from top to bottom"
  (let (candidates)
    (avy-dowindows arg
      (let ((ws (or beg (window-start))))
        (save-excursion
          (save-restriction
            (narrow-to-region ws (or end (window-end (selected-window) t)))
            (goto-char (point-min))
            (while (< (point) (point-max))
              (when (member (get-char-property
                             (max (1- (point)) ws) 'invisible) '(nil org-link))
                (push (cons
                       (if (eq avy-style 'post)
                           (line-end-position)
                         (save-excursion
                           (when avy-indent-line-overlay
                             (skip-chars-forward " \t"))
                           (point)))
                       (selected-window)) candidates))
              (if visual-line-mode
                  (line-move-visual 1 t)
                (forward-line 1)))))))
    (if bottom-up
        candidates
      (nreverse candidates))))