nvim-telescope/telescope.nvim

Error when previewing Markdown files

frixaco opened this issue · 2 comments

Description

This is happening on master branch, when previewing Markdown files for the FIRST time. It works fine on 0.1.6.

Error executing vim.schedule lua callback: vim/filetype.lua:0: attempt to call a nil value stack traceback:
    vim/filetype.lua: in function ‹vim/filetype.lua:0>
    vim/filetype.lua: in function
    vim/filetype. lua: in function 'match"
    ... scope.nvim/lua/telescope/previewers/buffer_previewer.lua:213: in function "*
    vim/_editor.lua: in function < vim/_editor.lua:

Thank you for the amazing plugin and let me know if you need more details.

Neovim version

NVIM v0.10.0-dev-2913+g5371ed36b
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188

Operating system and version

macOS 14.4.1

Telescope version / branch / rev

master

checkhealth telescope

telescope: require("telescope.health").check()

Checking for required plugins ~
- OK plenary installed.
- WARNING nvim-treesitter not found. (Required for `:Telescope treesitter`.)

Checking external dependencies ~
- OK rg: found ripgrep 14.1.0
- OK fd: found fd 9.0.0

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

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

Steps to reproduce

  1. Open Neovim with provided minimal config
  2. :Telescope find_files
  3. Search for markdown files

Expected behavior

I can preview markdown files without any errors.

Actual behavior

Getting an error when previewing Markdown 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()]]

If I'm interpreting that error message correctly, it looks like it failed calling vim.filetype.match because vim.filetype is nil?
My guess is there some issues with neovim runtime files. I would try reinstalling neovim and see if that helps.

@jamestrew Thank you!! That worked. With clean neovim build from source, I don't see any errors. Closing the issue.