nvim-autopairs
nvim-autopairs copied to clipboard
nvim-autopairs is breaking `i_CTRL-G_j` commands
Description
The plugin is breaking the <C-g>j
/<C-g>k
behaviour in insert mode.
From :h insert-index
:
i_CTRL-G_j
CTRL-G CTRL-J
line down, to column where inserting startedi_CTRL-G_j
CTRL-G j
line down, to column where inserting started
But if the cursor begin the edit inside a pair, then <C-g>j
is not moving to the column where inserting started.
Mapping bug
No response
Steps to reproduce
- Open a new file with
nvim-autopairs
enabled. - Write this content:
1. ""
2. ""
- In normal mode move the cursor inside the first
"
pair. -
i
and typetest()
- Now, still in insert mode, press
<C-g>j
- The cursor move outside the second
"
pair.
Expected behaviour:
- Open a clean nvim instance:
$ nvim --clean foo
Repeat steps 2 through 5. - The cursor move inside the second
"
pair.
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',
},
},
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()]]