mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Fix docs
This commit is contained in:
parent
e8bde2fe61
commit
d2174f1d29
2 changed files with 3 additions and 4 deletions
|
|
@ -89,7 +89,7 @@ if you want to disable the module for some languages you can pass a list to the
|
||||||
EOF
|
EOF
|
||||||
<
|
<
|
||||||
|
|
||||||
For more fine-grained control, `disabled` can also take a function and
|
For more fine-grained control, `disable` can also take a function and
|
||||||
whenever it returns `true`, the module is disabled for that buffer.
|
whenever it returns `true`, the module is disabled for that buffer.
|
||||||
The function is called once when a module starts in a buffer and receives the
|
The function is called once when a module starts in a buffer and receives the
|
||||||
language and buffer number as arguments:
|
language and buffer number as arguments:
|
||||||
|
|
|
||||||
|
|
@ -352,11 +352,11 @@ function M.is_enabled(mod, lang, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local disable = module_config.disable
|
local disable = module_config.disable
|
||||||
if type(disable) == 'function' then
|
if type(disable) == "function" then
|
||||||
if disable(lang, bufnr) then
|
if disable(lang, bufnr) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
elseif type(disable) == 'table' then
|
elseif type(disable) == "table" then
|
||||||
-- Otherwise it's a list of languages
|
-- Otherwise it's a list of languages
|
||||||
for _, parser in pairs(disable) do
|
for _, parser in pairs(disable) do
|
||||||
if lang == parser then
|
if lang == parser then
|
||||||
|
|
@ -365,7 +365,6 @@ function M.is_enabled(mod, lang, bufnr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue