-
-
Notifications
You must be signed in to change notification settings - Fork 910
Description
Description
Over the years there were several fixes for issues related to [re]drawing the picker window:
Unfortunately the fixes result in moving the cursor to either first or last line in the buffer, ignoring the desired selection index. Manually scrolling up or down moves the cursor position into the right place.
I think the simplest way to fix this is to move to { self._selection_row + 1, 0 } instead of { self.max_results, 1 } (by the way, why 1?) or { 1, 0 } (depending on the sort option).
Neovim version
NVIM v0.11.1-dev-66+ge342b9a25a
Build type: Release
LuaJIT 2.1.1741730670
Operating system and version
Linux
Telescope version / branch / rev
master
checkhealth telescope
==============================================================================
telescope: require("telescope.health").check()
Checking for required plugins ~
- ✅ OK plenary installed.
- ✅ OK nvim-treesitter installed.
Checking external dependencies ~
- ✅ OK rg: found ripgrep 14.1.1
- ✅ OK fd: found fdfind 10.2.0
===== Installed extensions ===== ~
Telescope Extension: `file_browser` ~
- No healthcheck provided
Telescope Extension: `fzf` ~
- ✅ OK lib working as expected
- ✅ OK file_sorter correctly configured
- ✅ OK generic_sorter correctly configured
Steps to reproduce
Create a custom picker based on a table providing many entries and set sufficiently large default_selection_index. Observe the cursor on the 1st line instead of scrolling to the desired entry.
Expected behavior
Cursor is positioned at the right entry.
Actual behavior
Observe the cursor on the 1st line instead of scrolling to the desired entry (assuming ascending sort option).
Minimal config
N/A