IntelliPrompt Behaviour Question (Pressing Space)

SyntaxEditor for WPF Forum

Posted 12 years ago by \アッカリーン/
Version: 12.2.0571
Avatar

Hi there,

I have a question... I'd like to use the intelliprompt like this:

A user starts typing text, and the prompt automatically pops open when the user types 3 characters or more, the list will be pre-populated with all individual words that have been typed into the editor that start with those three letters, (probably something like "\b[a-zA-Z0-9]+\b"), and the user can select one of the words by pressing enter, continuing to type to help filter down the results more, or scrolling and clicking on one of the items, but if they press space, the prompt will disappear and close, rather than completing...

I tried looking around at the current controls for the prompt, but couldn't find anything that would let me control the behavior of the space key, as I'd like to get it to cancel, rather than attempt to complete, or search for a larger string with spaces.

Obviously this feature would only be used on relatively small documents, but it would be extremely helpful for my application. It's also a feature built into Kate, KDE's text editor on Linux, which speeds document editing up tremendously in certain circumstances. Looking at what's available (properties, events, etc.), I'm pretty sure I can handle writing the dictionary feature to collect the words on my own, it's just controlling the intelliprompt to do what I want (controlling when it appears and adjusting the behavior of the space key), I'm not so sure about.

Thanks for your time!

Comments (1)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi, you could create a class that inherits CompletionSession and override OnViewTextInput.  If you detect a space, call this.Cancel() and return without calling hte base method.

Otherwise, characters that aren't in the session's AllowedCharacters collection will trigger an auto-complete if there is a match currently in the list.


Actipro Software Support

The latest build of this product (v24.1.2) was released 10 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.