refactor!: remove % and $ autopairs rules (#3759)

This commit is contained in:
Jieru Mei 2023-01-23 03:31:29 -08:00 committed by GitHub
parent 2d3140f0d7
commit 8ea68830a0
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,6 @@ M.setup = function()
if not status_ok then
return
end
local Rule = require "nvim-autopairs.rule"
autopairs.setup {
check_ts = lvim.builtin.autopairs.check_ts,
@ -72,17 +71,6 @@ M.setup = function()
fast_wrap = lvim.builtin.autopairs.fast_wrap,
}
require("nvim-treesitter.configs").setup { autopairs = { enable = true } }
local ts_conds = require "nvim-autopairs.ts-conds"
-- TODO: can these rules be safely added from "config.lua" ?
-- press % => %% is only inside comment or string
autopairs.add_rules {
Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node { "string", "comment" }),
Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node { "function" }),
}
if lvim.builtin.autopairs.on_config_done then
lvim.builtin.autopairs.on_config_done(autopairs)
end