Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add another setting for confirming a suggestion: Enter, but only when explicitly selected #943

Open
adamreisnz opened this issue Jan 10, 2018 · 4 comments

Comments

@adamreisnz
Copy link

adamreisnz commented Jan 10, 2018

I find that autocomplete is often inserting suggestions when I don't want it to. This happens for example when I've just finished typing a line of code and am about to hit enter, then boom it auto selects a suggestion and I have to go back up and erase it.

Switching the auto complete trigger to TAB doesn't work either, because I use tab often as well and it has the same problem.

Increasing the time after which the suggestions appear doesn't help either, because then when I do want them to appear, I have to wait what seems like forever.

Ideally, I would want autocomplete to never insert an autocompletion, unless I explicitly select one by moving arrow keys up or down.

Basically I'd like to see a 5th option in this list:

image

Enter, but only when explicitly selected

I've tried disabling autocomplete altogether at one point because it was driving me crazy, but that didn't help either because I do use it from time to time.

@adamreisnz adamreisnz changed the title Add another setting for confirming a suggestion Add another setting for confirming a suggestion: Enter, but only when explicitly selected Jan 10, 2018
@fats
Copy link

fats commented Jan 18, 2018

I second @adamreisnz's suggestion here. If I choose anything from the list explicitly, it should autocomplete.

When using autocomplete-plus with the built-in provider, it can autocomplete to almost any word from any buffer (especially with large projects). This makes it too hard to type anything with the currently available settings. I could never get it to work properly, and I often fight autocomplete to type what I want.

One more thing about this suggested setting:

Currently, when the autocomplete list appears, the first row is automatically highlighted/selected and it awaits confirmation. If this explicit selection suggestion is implemented, this would mean that you have to move the cursor down and then up again to select the first row for confirmation.

Instead, it should have no row selected or highlighted by default, and a "move down" event should select the first row for confirmation.

@adamreisnz
Copy link
Author

Good point, and agree with the suggested change of not having the first row selected by default 👍

@adamreisnz
Copy link
Author

Anyone willing to draft a PR for this?

It's the single most annoying thing about this package. I use TAB and ENTER for navigating my code constantly, and I don't want to use either for confirming an auto complete unless I have explicitly selected a value.

For example, how is the following auto completion useful? I'm wasting so much time on undoing stuff like this:

ss

cc @benogle @joefitzgerald @nathansobo

@allefeld
Copy link

allefeld commented Nov 23, 2019

Completely agree. Autocomplete keeps getting in the way, no matter how I configure it.

Example: I write CSS, property: and hit Tab to get aligned property values. Instead I get some random :: selector which doesn't even make sense there.

Example: I write text, a list of phrases, and hit Enter to make a new line. Instead the last word gets "completed" by some random word.

If it stays this way I will have to disable it.

I would prefer that a suggestion is only confirmed after it has been explicitly selected. The suggestion by @adamreisnz would work for me. Alternatively, have three options:

  • confirm by Tab
  • confirm by Enter
  • confirm only if explicitly selected

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

No branches or pull requests

3 participants