[PyKDE] Trivial improvement in the autocompletion of Eric3

Phil Thompson phil at riverbankcomputing.co.uk
Sat Jun 26 12:32:01 BST 2004


On Saturday 26 June 2004 8:02 pm, Maurizio Colucci wrote:
> Hello,
>
> IMHO, with a small change, eric3 would become much more usable.
>
> I noticed there is a good autocompletion feature, with a listbox that pops
> up; then you move with the arrows. The overall result is similar to emacs'
> (M-/) autocompletion feature. The only problem is that the list is not
> sorted by distance. So it takes many presses on the down arrow to reach the
> correct completion (on average).
>
> Example:
> imagine the contents of the file is as follows:
>
> hbbbbbbb
> hddddddd
> h                       <<< we press "h" here
> hccccccccc
> haaaaaaaaa
>
> and suppose we press h in the middle of the file. Then, the list of
> completions should be sorted as follows:
> [ hdddddd, hcccccccc, hbbbbbbb, haaaaaa]
>
> that is, not by name, but by distance (and if two words have the same
> distance, you prefer the one above).
>
> I think if eric3 could have such a feature, I would prefer it over emacs
> for editing my code.
>
> Thanks for any comment :-)

I don't understand why a "near" word is more likely to be the one you want to 
type than a "distant" word.

I would think people use auto-completion for two reasons...

1. To save typing, ie. you know the spelling. In this case you don't use the 
arrow keys to move through the list. Instead you keep typing the word until 
it becomes the current one in the list, then you select it. In this case the 
order is irrelevant.

2. When you can't remember the spelling, so you type as much as you can 
remember, then use the list to pick the right (probably only) one. In this 
case you want a predictable order, not one that is context sensitive. You 
wouldn't know if you needed to scroll the list upwards or downwards to find 
what you want.

Phil




More information about the PyQt mailing list