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

fix(super-tab): tab should respect manual selection #600

Conversation

minusfive
Copy link
Contributor

When using the super-tab preset and the completion.list.selection option is set to "manual", the custom <Tab> keymap doesn't respect it and still selects and accepts the first option.

Simply ensuring cmp.accept() is triggered when this option is set (instead of cmp.select_and_accept()) works because cmp.accept() internally checks whether a completion item is selected, and if it isn't it exits without executing anything.

@minusfive minusfive changed the title fix(blink): super-tab.Tab should respect manual selection fix(super-tab): tab should respect manual selection Dec 16, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 17, 2024

We should change the default to "accept", "snippet_forward", "select_and_accept", "fallback". Would need to double check that this behavior works as expected, but I'd expect it to:

  • In a snippet, jump to the next tab stop when there's no selection
  • In a snippet, accept when there's a selection
  • Otherwise, select the first item when there's no selection and accept

@minusfive
Copy link
Contributor Author

@folke FYI 👆. If so we should coordinate and tweak LV.

@Saghen
Copy link
Owner

Saghen commented Dec 20, 2024

It seems like the behavior I explained above is already the default, closing this as it works as expected. You can change your configuration to 'accept', 'snippet_forward', 'fallback' to get the behavior you're looking for

@Saghen Saghen closed this Dec 20, 2024
@minusfive
Copy link
Contributor Author

@Saghen sorry, I may be confused, but isn't the point of selection = "manual" that no item is selected by default, ever?

When combined with super-tab my expectation by default would be:

  • Enter insert mode, I'm not in a snippet, I start typing
  • Completion menu appears with nothing selected by default ("manual")
  • I press Tab and since nothing is selected it would just insert a normal Tab (or spaces) as expected with no completion

If I wanted to have the first item selected by default I'd use "preselect".

Am I mistaken?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants