Skip to content

Commit

Permalink
feat(telescope): only reverse results when `sorting_strategy = "desce…
Browse files Browse the repository at this point in the history
…nding"` (#307)
  • Loading branch information
folke committed Oct 13, 2023
1 parent 9ef83d9 commit b811243
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/telescope/_extensions/aerial.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ local function aerial_picker(opts)
end

-- Reverse the symbols so they have the same top-to-bottom order as in the file
util.tbl_reverse(results)
default_selection_index = #results - (default_selection_index - 1)
if conf.sorting_strategy == "descending" then
util.tbl_reverse(results)
default_selection_index = #results - (default_selection_index - 1)
end
pickers
.new(opts, {
prompt_title = "Document Symbols",
Expand Down

0 comments on commit b811243

Please sign in to comment.