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

Breaks if tree-sitter disable config is a function & not a table.

Open ahmedelgabri opened this issue 3 years ago • 0 comments

It will break with the following errors

Error detected while processing BufReadPost Autocommands for "*":
E5108: Error executing lua ...im/pack/packer/start/filetype.nvim/lua/filetype/init.lua:8: Vim(lua):E5108: Error executing lua ...er/start/nvim-treesitter/lua/nvim-t
reesitter/configs.lua:335: bad argument #1 to 'pairs' (table expected, got function)
Press ENTER or type command to continue

When the disable key in `highlights in tree-sitter is a function, in my case, it looks like this

disable = function(lang, bufnr)
  return lang == 'org' or vim.api.nvim_buf_line_count(bufnr) > 10000
end

If I change it to this, it works fine.

disable = { 'org' }

ahmedelgabri avatar Nov 28 '21 00:11 ahmedelgabri