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

resuming the picker with multiple previewers doesn't respect which previewer was selected and which previewer title was shown before closing #2424

Closed
molecule-man opened this issue Mar 15, 2023 · 0 comments · Fixed by #2422
Labels
bug Something isn't working

Comments

@molecule-man
Copy link
Contributor

Description

resuming the picker with multiple previewers doesn't respect which previewer was selected before closing. Cycling the previewer doesn't change the previewer title which causes picker to be resumed with different title rather than with the previewer title that was shown at the moment of closing.

Neovim version

NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui

Operating system and version

Manjaro Linux 22.0.4

Telescope version / branch / rev

telescope v0.1.1

checkhealth telescope

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.7.0

## ===== Installed extensions =====

## Telescope Extension: `file_browser`
  - INFO: No healthcheck provided

## Telescope Extension: `fzf`
  - OK: lib working as expected
  - OK: file_sorter correctly configured
  - OK: generic_sorter correctly configured

## Telescope Extension: `luasnip`
  - INFO: No healthcheck provided

## Telescope Extension: `menufacture`
  - INFO: No healthcheck provided

Steps to reproduce

  1. run git_commits, map cycle_previewers_next
require('telescope.builtin').git_commits {
  attach_mappings = function(_, map)
    map('i', '<C-i>', require('telescope.actions').cycle_previewers_next)
    return true
  end,
}
  1. cycle through the previewers by invoking the mapping
  2. close the picker
  3. resume the picker :Telescope resume

Expected behavior

  1. resumed picker's previewer should be the same as the one that was used at the moment of closing
  2. resumed picker's previewer title should be the same as it was at the moment of closing

Actual behavior

  1. picker is always resumed with the first previewer
  2. resumed picker's previewer title is not the same as it was at the moment of closing

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant