aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick96 <p.ziegler96@gmail.com>2021-11-20 22:34:11 +0100
committerStephan Seitz <stephan.seitz@fau.de>2021-11-28 00:31:02 +0100
commitd2174f1d29086b51124d084f9402c5f9731f21bd (patch)
tree063ca821424221f352e379ecb9aba18aea22aca2
parentCompletely remove condition from documentation (diff)
downloadnvim-treesitter-d2174f1d29086b51124d084f9402c5f9731f21bd.tar
nvim-treesitter-d2174f1d29086b51124d084f9402c5f9731f21bd.tar.gz
nvim-treesitter-d2174f1d29086b51124d084f9402c5f9731f21bd.tar.bz2
nvim-treesitter-d2174f1d29086b51124d084f9402c5f9731f21bd.tar.lz
nvim-treesitter-d2174f1d29086b51124d084f9402c5f9731f21bd.tar.xz
nvim-treesitter-d2174f1d29086b51124d084f9402c5f9731f21bd.tar.zst
nvim-treesitter-d2174f1d29086b51124d084f9402c5f9731f21bd.zip
Fix docs
-rw-r--r--doc/nvim-treesitter.txt2
-rw-r--r--lua/nvim-treesitter/configs.lua5
2 files changed, 3 insertions, 4 deletions
diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt
index 323b8ab25..bf36fd74e 100644
--- a/doc/nvim-treesitter.txt
+++ b/doc/nvim-treesitter.txt
@@ -89,7 +89,7 @@ if you want to disable the module for some languages you can pass a list to the
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.
The function is called once when a module starts in a buffer and receives the
language and buffer number as arguments:
diff --git a/lua/nvim-treesitter/configs.lua b/lua/nvim-treesitter/configs.lua
index 3da54fd7e..cb0b8b5a8 100644
--- a/lua/nvim-treesitter/configs.lua
+++ b/lua/nvim-treesitter/configs.lua
@@ -352,11 +352,11 @@ function M.is_enabled(mod, lang, bufnr)
end
local disable = module_config.disable
- if type(disable) == 'function' then
+ if type(disable) == "function" then
if disable(lang, bufnr) then
return false
end
- elseif type(disable) == 'table' then
+ elseif type(disable) == "table" then
-- Otherwise it's a list of languages
for _, parser in pairs(disable) do
if lang == parser then
@@ -365,7 +365,6 @@ function M.is_enabled(mod, lang, bufnr)
end
end
-
return true
end