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

find_files throws an error in win_option about deprecated vim.tbl_islist call #3119

Closed
Zooce opened this issue May 19, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@Zooce
Copy link

Zooce commented May 19, 2024

Description

Telescope's find_files shows an error when called with custom dropdown theme:

local dropdown = function(preview)
  return require('telescope.themes').get_dropdown({
    borderchars = {
      { '', '', '', '', '', '', '', ''},
      prompt = {'', '', ' ', '', '', '', '', ''},
      results = {'', '', '', '', '', '', '', ''},
    },
    previewer = false,
    layout_config = { width = 0.7, height = 0.6 },
  })
end

vim.keymap.set('n', '<leader>/f', function() require('telescope.builtin').find_files(dropdown()) end, 'Search Files')

Neovim version

NVIM v0.11.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating system and version

Pop!_OS 22.04 LTS x86_64

Telescope version / branch / rev

0.1.x

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 14.1.0
- OK fd: found fd 8.3.1

===== Installed extensions ===== ~

Steps to reproduce

Open Neovim in a directory and run find_files with the custom dropdown theme as described above.

Expected behavior

No error

Actual behavior

vim.tbl_islist is deprecated, use vim.islist instead. :help deprecated
stack traceback:
        vim/shared.lua: in function 'tbl_islist'
        ...vim/lazy/telescope.nvim/lua/telescope/config/resolve.lua:295: in function 'win_option'
        ...vim/lazy/telescope.nvim/lua/telescope/pickers/window.lua:18: in function 'get_initial_window_options'
        ...lescope.nvim/lua/telescope/pickers/layout_strategies.lua:436: in function 'get_window_options'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:363: in function 'find'
        ...im/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:350: in function 'v'
        ...im/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:595: in function 'v'
        .../nvim/lazy/telescope.nvim/lua/telescope/builtin/init.lua:542: in function 'find_files'

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()]]
@Zooce Zooce added the bug Something isn't working label May 19, 2024
@Saywa94
Copy link

Saywa94 commented May 19, 2024

Yes. I have the same error without using dropdown. It only appears once when calling telescope for the first time. It triggers when calling: find_files, git_files, grep_string, keymaps, help_tags and buffers. (Those are the only ones I've used, it's probably triggered in most telescope.builtin functions)

@jamestrew
Copy link
Contributor

Neovim 0.10+ is only compatible with Telescope nightly (master branch) at the moment due to the breaking changes to neovim apis.

I'll try to coordinate downpatching the fix to the breaking apis.

@Conni2461
Copy link
Member

everything is backported to 0.1.x, ill do a 0.1.7 release within the next 10 minutes.

@Conni2461
Copy link
Member

should be solved with: https://github.com/nvim-telescope/telescope.nvim/releases/tag/0.1.7

thanks for reporting

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
Development

No branches or pull requests

4 participants