mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-11 07:15:44 +03:00
feat: disable insert pairs after visual block mode
This commit is contained in:
parent
fba2503bd8
commit
5da0994f6c
@ -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 disable_in_visualblock = false -- disable when insert after visual block mode
|
||||
local ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]],"%s+", "")
|
||||
local enable_moveright = true
|
||||
local enable_afterquote = true -- add bracket pairs after quote
|
||||
|
@ -17,6 +17,7 @@ local default = {
|
||||
map_cr = true,
|
||||
disable_filetype = { 'TelescopePrompt', 'spectre_panel' },
|
||||
disable_in_macro = false,
|
||||
disable_in_visualblock = false,
|
||||
ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], '%s+', ''),
|
||||
check_ts = false,
|
||||
enable_moveright = true,
|
||||
@ -132,14 +133,24 @@ local function is_disable()
|
||||
if M.state.disabled then
|
||||
return true
|
||||
end
|
||||
|
||||
if vim.bo.filetype == '' and api.nvim_win_get_config(0).relative ~= '' then
|
||||
-- disable for any floating window without filetype
|
||||
return true
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
if
|
||||
M.config.disable_in_macro
|
||||
and (vim.fn.reg_recording() ~= '' or vim.fn.reg_executing() ~= '')
|
||||
then
|
||||
return true
|
||||
end
|
||||
|
||||
if M.config.disable_in_visualblock and utils.is_block_wise_mode() then
|
||||
return true
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user