Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

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

Open
ahmedelgabri opened this issue Nov 28, 2021 · 0 comments
Open

Comments

@ahmedelgabri
Copy link

ahmedelgabri commented Nov 28, 2021

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' }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant