Skip to content

Empty string at end of collection causes selection to start at end of list #1230

@jschaf

Description

@jschaf

Using a collection with an empty string causes ivy-read to position the initial cursor at the end of the list.

Minimal reproducible case:

(defun ivy-bug-at-end-of-list ()
  (interactive)
  (ivy-read "Bug: "
            (list "1" "2" "3" "4" "5" "")
            :keymap ivy-minibuffer-map
            :action (lambda (x) (message "%s" x))))

Running that displays 1 through 5 in the minibuffer but not the empty string. The cursor starts outside the visible portion on the empty string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions