Auto-completion "eats" next symbol

Andreas Pakulat apaku at gmx.de
Thu Dec 9 16:52:21 UTC 2010


On 09.12.10 15:17:04, Julien Desgats wrote:
> Hey,
> I've noticed a particularly disturbing behavior (bug?) on
> auto-completion : when you type something while there is characters
> after cursor, they are erased until the end of word if you use
> auto-completion.
> 
> For instance if you have ("][" is the cursor)
>   f][bar(0);
> And auto-completion suggest "foo", if you validate that suggestion,
> you will get :
>   foo(][0);
> As you can see, the "bar" symbol has been erased. I think the correct
> behavior should be :
>   foo][bar(0);
> or
>   foo(][bar(0);
> 
> But if you are in the following situation :
>   f][ bar(0);  // notice the space between the cursor and "bar"
> The result of auto-completion will be :
>   foo(][) bar(0);
> 
> As a result, I'm constantly forced to add spaces in such situations to
> avoid auto-completion to eat existing symbols !
> 
> So, what do you think about this idea of improvement ?

/me too. Luckily I seldom have code right after the cursor when invoking
completion (I'm not using auto-completion at all, too annoying and slow).

In eclipse there's a setting for this AFAIK.

IMHO its possible to get both though, simply always insert the completed
text via normal kate api (whatever that is), in particular if the user
selected something it gets replaced by the completed text. This way if you
indeed want to replace some existing text with the completion you can first
select it then open completion. Only downside (except for a bit more work)
is that it probably doesn't work with auto-completion...

Andreas

-- 
You will never know hunger.




More information about the KDevelop-devel mailing list