Skip to content

Commit

Permalink
fix(ts): Annotations fix and config improvements.
Browse files Browse the repository at this point in the history
Signed-off-by: Guennadi Maximov C <[email protected]>
  • Loading branch information
DrKJeff16 committed Sep 4, 2024
1 parent 7cfb0bf commit 68b2dc6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lua/plugin/treesitter/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,11 @@ local ensure = {
'json',
'json5',
'jsonc',
'kconfig',
'lua',
'luadoc',
'luap',
'markdown',
'markdown_inline',
'meson',
'ninja',
'passwd',
'python',
'query',
Expand Down Expand Up @@ -75,25 +72,23 @@ local Opts = {
highlight = {
enable = true,

---@type fun(lang: string, buf: integer): boolean
---@param lang? string
---@param buf? integer
---@return boolean
disable = function(lang, buf)
local max_fs = 1024 * 1024
local ok, stats = pcall(fs_stat, buf_name(buf))

local disable_ft = {
'c',
'cpp',
'text',
}

local res = false

res = vim.tbl_contains(
disable_ft,
vim.api.nvim_get_option_value('ft', { scope = 'local' })
)
res = vim.tbl_contains(disable_ft, Util.ft_get(buf or 0))

return res or ok and not is_nil(stats) and stats.size > max_fs
return res or ok and not is_nil(stats) and stats.size > max_fs ---@diagnostic disable-line
end,
additional_vim_regex_highlighting = false,
},
Expand Down

0 comments on commit 68b2dc6

Please sign in to comment.