windwp / nvim-autopairs

autopairs for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`break_undo = false` doesn't respect `<CR>` mapping

rosingrind opened this issue · comments

Description

If this is intended behavior, feel free to close - I'm just not really sure if this is :)

  • from normal mode, perform i{<CR><ESC>
  • to undo actions you need to perform u twice

Mapping bug

:verbose imap <cr> result:

i  <CR>        * v:lua.MPairs.completion_confirm()
	Last set from Lua

Steps to reproduce

Screen.Recording.2023-08-12.at.9.12.07.AM.mp4

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'windwp/nvim-autopairs',
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('nvim-autopairs').setup()
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing nvim-autopairs and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]