Skip to content

fix(pickers): respect default_selection_index #3493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dtor
Copy link

@dtor dtor commented Jul 3, 2025

Description

Make sure to move the cursor to the row selected by self:_do_selection() instead of placing it onto the first (or last, depending on the sorting method) line of the picker window.

Fixes #3492

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

With a custom picker that generates a list of stgit patches and uses default_slection_index to select the "top" patch of the stack. Number of patches is sufficiently large.

Make sure to move the cursor to the row selected by self:_do_selection()
instead of placing it onto the first (or last, depending on the sorting
method) line of the picker window.

Fixes nvim-telescope#3492
@dtor dtor force-pushed the fix-default-slection-scroll branch from 8f6d104 to b759320 Compare July 4, 2025 00:25
@dtor
Copy link
Author

dtor commented Jul 4, 2025

Updated the commit to not error when a picker has no results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specifying default_selection_index that is larger than picker window does not work
1 participant