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

No equivalent to autocomplete.auto_show in reworked config #402

Closed
2 tasks done
jungomi opened this issue Nov 28, 2024 · 5 comments
Closed
2 tasks done

No equivalent to autocomplete.auto_show in reworked config #402

jungomi opened this issue Nov 28, 2024 · 5 comments
Labels
bug Something isn't working windows Module which displays UI

Comments

@jungomi
Copy link

jungomi commented Nov 28, 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

With the reworked config it is no longer possible to disable automatically triggering the completion. I only want to trigger the completion with the key mapping on demand, not having it constantly pop up.

Before the rework, this was achieved by setting autcomplete.auto_show = false, but I have not found anything that could do the same in the new config.

Relevant configuration

-- Config prior to rework
windows = {
  autocomplete = {
    auto_show = false,
  },
}

neovim version

NVIM v0.10.2

blink.cmp version: branch, tag, or commit

main

@jungomi jungomi added the bug Something isn't working label Nov 28, 2024
@Saghen Saghen closed this as completed in 69a69dd Nov 28, 2024
@Saghen
Copy link
Owner

Saghen commented Nov 28, 2024

Whoops, didn't mean to close. Setting both show_on_keyword = false and show_on_trigger_character = false should effectively be equivalent to auto_show. The only caveat is completions will no longer be prefetched so there will be a delay on opening. I'll leave this open for a dedicated auto_show on the menu window since it could be useful for using i.e. ghost_text only by default, and it would avoid the delay from fetching completions

@Saghen Saghen reopened this Nov 28, 2024
@jungomi
Copy link
Author

jungomi commented Nov 28, 2024

Thanks, that works great.

Prefetching would certainly be nice to have as well. I'd personally want the ghost_text to be tied to the menu, meaning that the prefetching should be completely in the background without having activated anything. But I guess you mean that both menu and ghost_text support the auto_show configuration independently.

I'm sure you will find an appropriate solution, just to give you my use case, as that seems to be the minority: I want everything to be hidden while prefetching happens in the background, then press the key map to show everything (menu + ghost_text + documentation).
This is exactly what I have got with the current config (without having the prefetching, as you mentioned).

That being said, I definitely see the appeal to have ghost_text alone, which would allow you to accept the first suggestion without opening the menu or open the menu to select another candidate. Now that I have written this out, I actually think that I might be using this, if it were implemented.

@Saghen Saghen added the windows Module which displays UI label Nov 29, 2024
@jungomi
Copy link
Author

jungomi commented Nov 29, 2024

I just realised that with these new settings it is impossible to narrow down the results once the completion is triggered, as it immediately closes the menu when typing any character.

Expected Behaviour

  • Trigger completion with key mapping
  • Type to fuzzy match completion results (keeps menu open)
  • Accept / Cancel / Hide to finish completion, which hides the menu

Essentially, from the time of triggering the completion with the key mapping it should temporarily behave as show_on_keyword = true until the menu is closed by one of the actions, or the keyword has been finished (e.g. when opening a parenthesis).

That is also how it functioned previously.

Saghen added a commit that referenced this issue Nov 29, 2024
@Saghen
Copy link
Owner

Saghen commented Nov 29, 2024

The new commit almost matches your desired behavior, except when typing a trigger character (i.e. .), if the completion menu is active, it'll stay open and update to a new list. I'll likely move that trigger character logic to another configuration option at some point

@jungomi
Copy link
Author

jungomi commented Nov 29, 2024

All good, as that is exactly how it behaved before the rework, so this issue has been resolved. I would have closed it, but since you said you'd leave it open for the dedicated auto_show on the menu, I'll let that up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Module which displays UI
Projects
None yet
Development

No branches or pull requests

2 participants