Highlighting part of ShorthandCompletion in RSyntaxTextArea

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Highlighting part of ShorthandCompletion in RSyntaxTextArea

Postby Guest » Mon Mar 18, 2013 5:50 pm

I have written a code calling calling RSyntaxTextArea and autocomplete. When the user enters function, the word will be replaces with function<>. I want to highlight the word "label" in the below code, so that the user knows they have to enter a name.

<code>
provider.addCompletion(new ShorthandCompletion(provider, "function", "function<Label>","funtion<Label>"));
</code>

The code basically replaces function with function and moves on instead of highlighting label and waiting for the user to enter something. How can I do this?
Guest
 

Re: Highlighting part of ShorthandCompletion in RSyntaxTextA

Postby robert » Mon Mar 18, 2013 9:44 pm

It sounds like you want to use a TemplateCompletion. Here's an example:

java code:

provider.add(new TemplateCompletion(provider, "function", null, "function<${label}>${cursor}");
User avatar
robert
 
Posts: 788
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron