Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

cristiansofronie
Copy link
Contributor

In Picker:new there was

    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
    end

so if a preview_title was not provided at creation it became static forever. This is a problem when you resume a picker as internal.resume calls Picker:new again and the same preview_title is populated during runtime by the dynamic_preview_title. So now that field is not nil and will become static forever.

To fix it add an additional check. If the picker is resumed and fix_preview_title is not already set by the first creation do not set it now.

This fixes #2689

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual testing. Set dynamic_preview_title = true in defaults when you setup Telescope and then open the find_files picker close it and resume.

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code

Copy link
Contributor

@jamestrew jamestrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks 👍

@jamestrew jamestrew merged commit 3d8e051 into nvim-telescope:master Sep 9, 2023
6 checks passed
Conni2461 pushed a commit that referenced this pull request Sep 10, 2023
…le became static (#2696)

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

* run stylua

(cherry picked from commit 3d8e051)
rameshsanth pushed a commit to rameshsanth/telescope.nvim that referenced this pull request Nov 17, 2023
…le became static (nvim-telescope#2696)

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

* run stylua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dynamic_preview_title doesn't update in builtin.resume picker
2 participants