mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-11 07:15:44 +03:00
feat: add option to disable when recording or executing a macro
This commit is contained in:
parent
8220306d01
commit
86dce0d460
@ -15,6 +15,7 @@ require('nvim-autopairs').setup{}
|
||||
|
||||
``` lua
|
||||
local disable_filetype = { "TelescopePrompt" }
|
||||
local disable_in_macro = false -- disable when recording or executing a macro
|
||||
local ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]],"%s+", "")
|
||||
local enable_moveright = true
|
||||
local enable_afterquote = true -- add bracket pairs after quote
|
||||
|
@ -15,6 +15,7 @@ local default = {
|
||||
map_bs = true,
|
||||
map_c_w = false,
|
||||
disable_filetype = { 'TelescopePrompt', 'spectre_panel' },
|
||||
disable_in_macro = false,
|
||||
ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], '%s+', ''),
|
||||
check_ts = false,
|
||||
enable_moveright = true,
|
||||
@ -133,6 +134,9 @@ local function is_disable()
|
||||
if vim.bo.modifiable == false then
|
||||
return true
|
||||
end
|
||||
if M.config.disable_in_macro and (vim.fn.reg_recording() ~= '' or vim.fn.reg_executing() ~= '') then
|
||||
return true
|
||||
end
|
||||
|
||||
if utils.check_filetype(M.config.disable_filetype, vim.bo.filetype) then
|
||||
-- should have a way to remove the mapping when vim.bo.filetype = ''
|
||||
|
Loading…
Reference in New Issue
Block a user