telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

Setting previewer to `true` errors out

Open krshrimali opened this issue 3 years ago • 1 comments

Description

Hi, I'm facing an issue where if I set previewer as true like:

find_files = {
    theme="anything",
    previewer=true
}

It breaks with the following error:


Hi, I'm facing a similar issue. Did anyone find a solution yet? If I put:

find_files = {
    theme="anything",
    previewer=true
}
It breaks when I hit the keympat for find_files:

Error executing Lua callback: ...ck/packer/start/telescope.nvim/lua/telescope/pickers.lua:147: attempt to index field 'all_previewers' (a boolean value)
stack traceback:
        ...ck/packer/start/telescope.nvim/lua/telescope/pickers.lua:147: in function 'new'
        ...r/start/telescope.nvim/lua/telescope/builtin/__files.lua:299: in function 'v'
        ...r/start/telescope.nvim/lua/telescope/builtin/__files.lua:529: in function 'v'
        ...cker/start/telescope.nvim/lua/telescope/builtin/init.lua:515: in function <...cker/start/telescope.nvim/lua/telescope/builtin/init.lua:484>
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:188: in function 'run_command'
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:253: in function 'load_command'
        ...te/pack/packer/start/telescope.nvim/plugin/telescope.lua:109: in function <...te/pack/packer/start/telescope.nvim/plugin/telescope.lua:108>

Neovim version

NVIM v0.8.0-dev-
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

macOS 12.5

Telescope version / branch / rev

telescope 0.1.0

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.4.0

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

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

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

Steps to reproduce

Stated in the issue description

Expected behavior

No response

Actual behavior

Failing with an error:

image

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({
    defaults = {
      pickers = {
         find_files = {
           previewer = true,
         }
      }
    })
  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()]]

krshrimali avatar Aug 27 '22 01:08 krshrimali

previewer was never a thing and is also not documented. You are looking for preview. Yes we have two keys preview and previewer doing completely different things, and i am not happy with it.

previewer is the function pointer to the function which returns a Previewer object. You can set it to false to not construct this object but we never documented that true actually does anything.

I dont know what we should do ...

Conni2461 avatar Sep 17 '22 08:09 Conni2461