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 started
i_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:
- In normal mode move the cursor inside the first
" pair.
i and type test()
- 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()]]
Description
The plugin is breaking the
<C-g>j/<C-g>kbehaviour in insert mode.From
:h insert-index:But if the cursor begin the edit inside a pair, then
<C-g>jis not moving to the column where inserting started.Mapping bug
No response
Steps to reproduce
nvim-autopairsenabled."pair.iand typetest()<C-g>j"pair.Expected behaviour:
$ nvim --clean fooRepeat steps 2 through 5.
"pair.Minimal config