Skip to content

Commit

Permalink
fix(internal.resume): dynamic_preview_title was not respected and tit…
Browse files Browse the repository at this point in the history
…le became static (#2696)

* fix(internal.resume): dynamic_preview_title was not respected and title became static

* run stylua

(cherry picked from commit 3d8e051)
  • Loading branch information
cristiansofronie authored and Conni2461 committed Sep 10, 2023
1 parent abe4bf5 commit 54930e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/telescope/builtin/__internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ internal.resume = function(opts)
picker.hidden_previewer = nil
opts.previewer = vim.F.if_nil(opts.previewer, false)
end
opts.resumed_picker = true
pickers.new(opts, picker):find()
end

Expand Down
6 changes: 5 additions & 1 deletion lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ function Picker:new(opts)
obj.all_previewers = { obj.all_previewers }
end
obj.previewer = obj.all_previewers[obj.current_previewer_index]
if obj.preview_title == nil or #obj.all_previewers > 1 then
if
obj.preview_title == nil
or #obj.all_previewers > 1
or opts.resumed_picker and opts.fix_preview_title ~= true
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 54930e1

Please sign in to comment.