mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-11 07:15:44 +03:00
Replace exclude_filetypes by not_filetypes
This commit is contained in:
parent
14bad1f3cd
commit
50fec950de
@ -194,7 +194,7 @@ npairs.add_rules({
|
|||||||
-- you can exclude filetypes
|
-- you can exclude filetypes
|
||||||
npairs.add_rule(
|
npairs.add_rule(
|
||||||
Rule("$$","$$")
|
Rule("$$","$$")
|
||||||
:with_pair(cond.exclude_filetypes({"lua"}))
|
:with_pair(cond.not_filetypes({"lua"}))
|
||||||
)
|
)
|
||||||
--- check ./lua/nvim-autopairs/rules/basic.lua
|
--- check ./lua/nvim-autopairs/rules/basic.lua
|
||||||
|
|
||||||
|
@ -198,15 +198,14 @@ cond.is_end_line = function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
cond.exclude_filetypes = function(filetypes)
|
cond.not_filetypes = function(filetypes)
|
||||||
return function(opts)
|
return function(opts)
|
||||||
log.debug('exclude_filetypes')
|
log.debug('not_filetypes')
|
||||||
for _, filetype in pairs(filetypes) do
|
for _, filetype in pairs(filetypes) do
|
||||||
if vim.bo.filetype == filetype then
|
if vim.bo.filetype == filetype then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ local data = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
setup_func = function()
|
setup_func = function()
|
||||||
npairs.add_rule(Rule("!", "!"):with_pair(cond.exclude_filetypes({"lua"})))
|
npairs.add_rule(Rule("!", "!"):with_pair(cond.not_filetypes({"lua"})))
|
||||||
end,
|
end,
|
||||||
name="disable pairs in lua",
|
name="disable pairs in lua",
|
||||||
filetype="lua",
|
filetype="lua",
|
||||||
@ -390,7 +390,7 @@ local data = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
setup_func = function()
|
setup_func = function()
|
||||||
npairs.add_rule(Rule("!", "!"):with_pair(cond.exclude_filetypes({"lua"})))
|
npairs.add_rule(Rule("!", "!"):with_pair(cond.not_filetypes({"lua"})))
|
||||||
end,
|
end,
|
||||||
name="enable pairs in html",
|
name="enable pairs in html",
|
||||||
filetype="html",
|
filetype="html",
|
||||||
|
Loading…
Reference in New Issue
Block a user