fix: wrap_results option breaking scrolling of results window (#2322)

This commit is contained in:
Sultanahamer
2023-02-19 16:15:30 +05:30
committed by GitHub
parent ccda9f02f3
commit 3d8bd0a105

View File

@@ -1327,6 +1327,11 @@ function Picker:get_result_completor(results_bufnr, find_id, prompt, status_upda
self:clear_extra_rows(results_bufnr)
self.sorter:_finish(prompt)
if self.wrap_results and self.sorting_strategy == "descending" then
local visible_result_rows = vim.api.nvim_win_get_height(self.results_win)
vim.api.nvim_win_set_cursor(self.results_win, { self.max_results - visible_result_rows, 1 })
vim.api.nvim_win_set_cursor(self.results_win, { self.max_results, 1 })
end
self:_on_complete()
end)
end