diff --git a/lua/nvim-autopairs.lua b/lua/nvim-autopairs.lua index cb7912c7..e41f1234 100644 --- a/lua/nvim-autopairs.lua +++ b/lua/nvim-autopairs.lua @@ -468,6 +468,10 @@ M.autopairs_map = function(bufnr, char) if M.config.enable_abbr then result = utils.esc(utils.key.abbr) .. result end + -- don't redraw the cursor twice + local old_lazyredraw = vim.o.lazyredraw + vim.o.lazyredraw = true + result = result .. utils.esc("lua vim.o.lazyredraw =" .. (old_lazyredraw and "true" or "false") .. "") log.debug("key_map :" .. result) return result end