Closed giuxtaposition closed 1 month ago
Having the same problem. This is my config:
return {
"saghen/blink.cmp",
lazy = false, -- lazy loading handled internally
dependencies = "rafamadriz/friendly-snippets",
version = "v0.*",
opts = {
keymap = {
show = "<C-space>",
hide = "<C-e>",
accept = "<CR>",
select_prev = { "<Up>", "<C-j>" },
select_next = { "<Down>", "<C-k>" },
show_documentation = {},
hide_documentation = {},
scroll_documentation_up = "<C-b>",
scroll_documentation_down = "<C-f>",
snippet_forward = "<Tab>",
snippet_backward = "<S-Tab>",
},
},
}
I found the problem, I have nvim-autopairs that uses enter to register pairs, I guess the two mappings get in conflict.
My workaround was to set map_cr = false
in nvim-autopairs config:
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
opts = {
disablee_in_macro = false,
map_cr = false,
},
}
The same problem occurs with mini.pairs
I don’t use mini.pairs, and I checked the
Same issue.
I'm also using nvim-autopairs
and can confirm that setting map_cr = false
resolves this but I use the behaviour that map_cr = true
enables.
Ideally blink can work alongside this config, perhaps can take a look at what nvim-cmp is doing to work here.
same thing happening with ultimate-autopair (another auto-pairing plugin), which also maps CR
.
Btw, am I the only one to find weird that <C-j>
is bounded to go <Up>
in the selection and <C-k>
to go <Down>
??
Feels counter intuitive.
Ah nevermind, I just saw there is already https://github.com/Saghen/blink.cmp/pull/23
@Saghen The commit ecb3510 breaks normal editing in a buffer:
It inserts this when pressing keys in insert mode
I'm not able to reproduce but does https://github.com/Saghen/blink.cmp/commit/5dd7d667228e3a98d01146db7c4461f42644d0c1 fix the issue for you?
Almost. It solved the issue reported above but now when accepting it nukes the first char:
Notice the missing bracket.
I typed:
(group-|)
;; Press <Cr>
group-by|)
Hmm actually, @Saghen that seems to be a different issue that existing before I just didn't notice.
It works if I do this:
(group-|)
;; <Cr>
(group-by|)
;; However, without the space it fails
(group-|)
;; <Cr>
group-by|)
I could open a new issue if you like.
New issue would be great, thanks!
But, while https://github.com/Saghen/blink.cmp/issues/20#issuecomment-2400217894 <- this issue is solved - This change did break the map_cr = true
behaviour from nvim-autopairs.
So in other words, when I am editing with nvim-autopairs then I expect the following behaviour:
fn main() {|}
// Press <Cr>
fn main() {
|
}
But now as of 5dd7d667228e3a98d01146db7c4461f42644d0c1 this behaviour is broken. Ideally we can find a way to both allow <Cr>
to accept without swallowing existing <Cr>
mappings on the buffer.
This behaviour pairing works fine on nvim-cmp
so I'm sure it's possible.
As per title, I'd like to accept the suggestion after pressing enter, but it's not working. Here's my config:
I've also tried
<cr>
and<Enter>
but nothing seems to work