slynch8 / 10x

10x IDE/Editor
190 stars 34 forks source link

Feature request: Sort autocomplete suggestions by nearest reference #968

Open stan680 opened 2 years ago

stan680 commented 2 years ago

Something I'm missing from 4coder is the heuristic it uses to order autocomplete suggestions.

If there are valid completions that are used in the current buffer, it orders them first, by nearest to the cursor.

This works really well in my experience - often the desired completion is sorted first after only 1 or 2 characters.

stan680 commented 2 years ago

Here's one small example:

static int my_global;

int main()
{
    int my_local;

    my_global = 1;
    m // autocompletes to my_local even though my_global is referenced nearer
}