Skip to content

Commit

Permalink
fix: preview cycling and titles work after :Telescope resume (#2422)
Browse files Browse the repository at this point in the history
  • Loading branch information
molecule-man committed Mar 21, 2023
1 parent a3f17d3 commit 10ebb30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function Picker:new(opts)
sorter = opts.sorter or require("telescope.sorters").empty(),

all_previewers = opts.previewer,
current_previewer_index = 1,
current_previewer_index = opts.current_previewer_index or 1,

default_selection_index = opts.default_selection_index,

Expand Down Expand Up @@ -147,8 +147,8 @@ function Picker:new(opts)
if obj.all_previewers[1] == nil then
obj.all_previewers = { obj.all_previewers }
end
obj.previewer = obj.all_previewers[1]
if obj.preview_title == nil then
obj.previewer = obj.all_previewers[obj.current_previewer_index]
if obj.preview_title == nil or #obj.all_previewers > 1 then
obj.preview_title = obj.previewer:title(nil, config.values.dynamic_preview_title)
else
obj.fix_preview_title = true
Expand Down

0 comments on commit 10ebb30

Please sign in to comment.