mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-19 03:47:33 +03:00
fix get_rule
This commit is contained in:
parent
f37f569ac0
commit
20ac7ee499
@ -63,12 +63,15 @@ M.add_rule = function (rule)
|
||||
table.insert(M.config.rules, rule)
|
||||
end
|
||||
|
||||
M.get_rule = function(rule)
|
||||
M.get_rule = function(start_pair)
|
||||
local tbl = {}
|
||||
for _,r in pairs(M.config.rules) do
|
||||
if r.start_pair == rule then
|
||||
return r
|
||||
if r.start_pair == start_pair then
|
||||
table.insert(tbl, start_pair)
|
||||
end
|
||||
end
|
||||
if #tbl == 1 then return tbl[1] end
|
||||
return tbl
|
||||
end
|
||||
|
||||
M.remove_rule = function (pair)
|
||||
|
Loading…
Reference in New Issue
Block a user