m4xshen / autoclose.nvim

A minimalist Neovim plugin that auto pairs & closes brackets
MIT License
520 stars 15 forks source link

<CR> in insert mode does nothing #11

Closed nagy135 closed 1 year ago

nagy135 commented 1 year ago

Hi, not sure what context should i provide but for some reason after installing this plugin in insert mode does nothing. I disabled all of my plugins to test if something clashes but still the same. Any ideas?

NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura-arm64.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.1/share/nvim"

Run :checkhealth for more info
nagy135 commented 1 year ago

after reading your code, there is no way its fault of this plugin ...will investigate elsewhere

ripytide commented 1 year ago

I also have just had this exact problem, deleting lines: https://github.com/m4xshen/autoclose.nvim/blob/ec7bf9013584e92e0a07b190c936b2c4563e961a/lua/autoclose.lua#L18-L19 fixed this for me though, perhaps it's remapping \?

gilbh commented 1 year ago

Had a similar conflict with Coc, when <CR> would not work because of this remapping.

Any chance of making the following lines disabled as an option in the configuration?

      ["<BS>"] = {},
      ["<C-H>"] = {},
      ["<C-W>"] = {},
      ["<CR>"] = {},
      ["<S-CR>"] = {},
m4xshen commented 1 year ago

I also have just had this exact problem, deleting lines:

https://github.com/m4xshen/autoclose.nvim/blob/ec7bf9013584e92e0a07b190c936b2c4563e961a/lua/autoclose.lua#L18-L19 fixed this for me though, perhaps it's remapping ?

Do you also use coc?

ripytide commented 1 year ago

Do you also use coc?

I do not, I use the build-in nvim LSP with nvim-cmp etc..

DonnieWest commented 1 year ago

I can also confirm autoclose disables the enter key on my computer. Deleting those lines also fixes the problem for me. I also use the build-in LSP w/ nvim-cmp

I'm happy to do any troubleshooting if necessary

m4xshen commented 1 year ago

@DonnieWest could you disable the nvim-cmp and then try whether the enter key works?

DonnieWest commented 1 year ago

That was my assumption too. Disabling nvim-cmp didn't fix it for me.

FWIW I narrowed it down to this plugin by disabling my plugins in a binary-search like fashion. It was only by disabling this plugin that I solved the problem

m4xshen commented 1 year ago

What's your config options for autoclose.nvim?

DonnieWest commented 1 year ago

I can replicate the issue by simply calling setup with no config supplied, or the entire default config passed in