Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close bracket by moving to out of the paired bracket. #451

Open
goulf-3m opened this issue Apr 25, 2024 · 0 comments
Open

Close bracket by moving to out of the paired bracket. #451

goulf-3m opened this issue Apr 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@goulf-3m
Copy link

Description

For (), they typically exist on the same line. Type ) in the context (*), the result is ()*, which is expected.
The same is true for {} on the same line.

However, {} pairs typically span multiple lines. In such cases, a similar behavior is not possible.
Namely, I cannot move to the right of } on the next line by pressing } in insert mode.

Mapping bug

No response

Steps to reproduce

If I have

int x() {
  *
}

I want to close the function an write int y(), without leaving insert mode. But if I press }, I simply get:

int x() {
  }*
}

I'd expect:

int x() {
 
}*

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()]]
@goulf-3m goulf-3m added the bug Something isn't working label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant