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
|
||||
npairs.add_rule(
|
||||
Rule("$$","$$")
|
||||
:with_pair(cond.exclude_filetypes({"lua"}))
|
||||
:with_pair(cond.not_filetypes({"lua"}))
|
||||
)
|
||||
--- check ./lua/nvim-autopairs/rules/basic.lua
|
||||
|
||||
|
@ -198,15 +198,14 @@ cond.is_end_line = function()
|
||||
end
|
||||
end
|
||||
|
||||
cond.exclude_filetypes = function(filetypes)
|
||||
cond.not_filetypes = function(filetypes)
|
||||
return function(opts)
|
||||
log.debug('exclude_filetypes')
|
||||
log.debug('not_filetypes')
|
||||
for _, filetype in pairs(filetypes) do
|
||||
if vim.bo.filetype == filetype then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -380,7 +380,7 @@ local data = {
|
||||
},
|
||||
{
|
||||
setup_func = function()
|
||||
npairs.add_rule(Rule("!", "!"):with_pair(cond.exclude_filetypes({"lua"})))
|
||||
npairs.add_rule(Rule("!", "!"):with_pair(cond.not_filetypes({"lua"})))
|
||||
end,
|
||||
name="disable pairs in lua",
|
||||
filetype="lua",
|
||||
@ -390,7 +390,7 @@ local data = {
|
||||
},
|
||||
{
|
||||
setup_func = function()
|
||||
npairs.add_rule(Rule("!", "!"):with_pair(cond.exclude_filetypes({"lua"})))
|
||||
npairs.add_rule(Rule("!", "!"):with_pair(cond.not_filetypes({"lua"})))
|
||||
end,
|
||||
name="enable pairs in html",
|
||||
filetype="html",
|
||||
|
Loading…
Reference in New Issue
Block a user