AutoComplete does not replace the whole word

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: AutoComplete does not replace the whole word

Re: AutoComplete does not replace the whole word

Post by as3boyan » Mon Sep 16, 2013 8:24 pm

You know, many IDEs do this in same way.

Re: AutoComplete does not replace the whole word

Post by robert » Sat Sep 14, 2013 2:35 am

Yes, the behavior your describe is ow things are currently implemented. Feel free to send a patch or merge request.

AutoComplete does not replace the whole word

Post by schlm3@gmail.com » Fri Sep 13, 2013 2:56 pm

Hi
I noticed the following behavior in AutoCompletion.java:
I have written Autocompletion for XPath expressions.
If the user enters an XPath like "Store/Items/Books", then presses "Ctrl-Space" while the cursor is at the end of the XPath, performing an autocomplete replaces the "Books" correctly.
If on the other hand, the cursor is between B and o while performing the autocomplete, the autocomplete only replaces the "B" with the new word and the "ooks" remains at the end, thus getting for example "Store/Items/Bananasooks".

I wonder if the current behavior is the behavior you have expected, since it does not behave like - for example - eclipse.

I have found the method AutoCompletion.insertCompletion(..) to be the source of this and changed the behavior for my implementation in a subclass of AutoCompletion. Unfortunately this implementation does not integrate with the framework very well, since it requires the use of the "isValidChar(char ch)" method from my custom completion implementation. If you are interested, I could provide you with a proposal for AutoCompletion which adds a "replaceTypedWord" option. However it would require an additional method in the "CompletionProvider" interface and changing all implementors would be out of scope for me.

With kind regards,
Markus

Top

cron