overriding typing ')' char action behaviour

Questions on using RSyntaxTextArea should go here.

Moderator: robert

overriding typing ')' char action behaviour

Postby as3boyan » Tue Sep 24, 2013 6:09 pm

NetBeans does something like this:
|);
where | - caret position. If I will try to type ')' again, and if there all brackets closed - it will just move caret one character forward instead of inserting ')'. Seems like I need to override some typing action to do that, I saw, you got some action like, move one character forward, or maybe I need to subclass typing action.

I could do this by adding KeyListener, but I'm not sure if this is a good idea.
as3boyan
 
Posts: 19
Joined: Mon Sep 16, 2013 8:21 pm

Re: overriding typing ')' char action behaviour

Postby robert » Sat Sep 28, 2013 12:48 am

The AutoComplete library has support for this, which is used by RSTALanguageSupport for e.g. C function completions and Java method completions.

You should look at ParameterizedCompletions such as FunctionCompletion, and perhaps also TemplateCompletions.
User avatar
robert
 
Posts: 801
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron