fix results win cursor for sorting_strategy descending (#2679)

* add an additional nvim_win_set_cursor

* Fix after filter

* remove redundant check

* use `redraw!` to replace ugly `nvim_win_set_cursor`

* redraw results win in `on_lines`

* use move instead of redraw

* fix

* keep both!

* fix!

* fix!
This commit is contained in:
Hawtian Wang
2023-09-03 06:07:57 +08:00
committed by GitHub
parent 2c1ed33a6f
commit 3fae9c1e14

View File

@@ -1333,7 +1333,7 @@ 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
if 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 })