on master help sign in
fix replace mode
commit6b6e35fc9aca1030a74cc022220bc22ea6c5daf4 authorzztrieuzz <zztrieuzz@gmail.com> dateThu 20 Oct 2022, 20:10 (4 years ago) parent4fc96c8
2 files changed+6
README.md+1 lua/nvim-autopairs.lua+5
README.md+1
@@ -33,6 +33,7 @@ use {
3333local disable_filetype = { "TelescopePrompt" }
3434local disable_in_macro = false -- disable when recording or executing a macro
3535local disable_in_visualblock = false -- disable when insert after visual block mode
36+local disable_in_replace_mode = true
3637local ignored_next_char = [=[[%w%%%'%[%"%.]]=]
3738local enable_moveright = true
3839local enable_afterquote = true -- add bracket pairs after quote
lua/nvim-autopairs.lua+5
@@ -19,6 +19,7 @@ local default = {
1919 disable_filetype = { 'TelescopePrompt', 'spectre_panel' },
2020 disable_in_macro = false,
2121 disable_in_visualblock = false,
22+ disable_in_replace_mode = true,
2223 ignored_next_char = [=[[%w%%%'%[%"%.]]=],
2324 break_undo = true,
2425 check_ts = false,
@@ -165,6 +166,10 @@ local function is_disable()
165166 return true
166167 end
167168
169+ if M.config.disable_in_replace_mode and vim.api.nvim_get_mode().mode == "R" then
170+ return true
171+ end
172+
168173 if M.config.disable_in_visualblock and utils.is_block_wise_mode() then
169174 return true
170175 end