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

auto_insert should probably be disabled for cmdline and search completion #523

Closed
2 tasks done
djdv opened this issue Dec 13, 2024 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working cmdline Related to the command line

Comments

@djdv
Copy link

djdv commented Dec 13, 2024

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

It seems like cycling the menu at all with auto_insert enabled, will cause chaos; entering each menu item as a command - as you cycle them.

In this video, I type :O and cycle with <Tab> once, then exit with <Esc>.
:Oil is invoked without me accepting the suggestions.
/~https://github.com/user-attachments/assets/4e14de9d-6391-4a22-a606-ea79cccb5320

I'd like to leave auto_insert and the cmdline completion both enabled, but this causes conflict with the cmdline.

Relevant configuration

completion = { list = { selection = 'auto_insert' }}
keymap = {
	['<Tab>'] = {
		function(cmp)
			if cmp.is_visible then
				return cmp.select_next()
			end
			if cmp.snippet_active() then
				return cmp.snippet_forward()
			end
			return false -- key not handled by us.
		end,
		"fallback"
	},
	['<Esc>'] = {
		function(cmp)
			if cmp.is_visible() then
				return cmp.cancel()
			end
		end,
		'fallback'
	},
}

neovim version

NVIM v0.11.0-dev-1345+g98027b8a71 Build type: Release LuaJIT 2.1.1732813678

blink.cmp version: branch, tag, or commit

1eda2b9

@djdv djdv added the bug Something isn't working label Dec 13, 2024
Saghen added a commit that referenced this issue Dec 13, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 13, 2024

You weren't kidding about the chaos :D The latest commit is quite hacky for now, but seems to work well on my system. Lmk how it looks on your end!

@Saghen Saghen added the cmdline Related to the command line label Dec 13, 2024
@djdv
Copy link
Author

djdv commented Dec 13, 2024

Thanks :^]
The workaround seems fine for my config.
Using manual or auto_insert seem okay after the commit, but selection = 'preselect' seems to still have the issue.


As an aside, cycling through the cmdline suggestions has a significant delay for me.
This was the case prior to the patch as well (when using manual selection).
Suggestions in the buffer from sources like the LSP, etc. are no problem (fast).
I'm not sure the source of that issue though.

@djdv
Copy link
Author

djdv commented Dec 13, 2024

cycling through the cmdline suggestions has a significant delay for me.

Some commit between 1eda2b9...f9b72e3 in blink, or some commit in neovim between 17383870dd...f9dd682621 seems to have fixed this for me. 🥳

@Saghen
Copy link
Owner

Saghen commented Dec 13, 2024

Sounds good!

@Saghen Saghen closed this as completed Dec 13, 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 cmdline Related to the command line
Projects
None yet
Development

No branches or pull requests

2 participants