Skip to content

Commit

Permalink
fix results win cursor for sorting_strategy descending (#2679)
Browse files Browse the repository at this point in the history
* 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!
  • Loading branch information
TwIStOy authored Sep 2, 2023
1 parent 2c1ed33 commit 3fae9c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down

0 comments on commit 3fae9c1

Please sign in to comment.