jump by word, stop at dot?

Questions on using RSyntaxTextArea should go here.

Moderator: robert

jump by word, stop at dot?

Postby Nate » Wed Dec 23, 2009 8:49 am

When I press ctrl+arrow to jump by word, is it possible to make my RSyntaxTextArea stop at a period? Eg:

Code: Select all
pg3b.set(true)


The cursor stops at the beginning and before and after each parenthesis. I'd like it to also stop before and after the dot.
Nate
 
Posts: 15
Joined: Fri Dec 04, 2009 6:45 am

Re: jump by word, stop at dot?

Postby Nate » Wed Dec 23, 2009 11:47 am

Found an unrelated issue. I'll just go ahead and post it here rather than create a bunch of tiny threads. :)

I have a bunch of functions in my completion file. This is great, except if I need to call a method of the same name on an object. Eg..

Code: Select all
controller.get(


As soon as I type the open parenthesis, I get the autocompletion for the get function (which is totally unrelated to the controller's get method!). Is it possible to not automatically popup the autocompletion box if it looks like a method call rather than a function call (ie, it is after a dot)?
Nate
 
Posts: 15
Joined: Fri Dec 04, 2009 6:45 am

Re: jump by word, stop at dot?

Postby Guest » Wed Dec 23, 2009 11:37 pm

Is font anti aliasing turned off for the RSTA? Can it be turned on? At some font sizes I see some anomalies that bug me. :)
Guest
 

Re: jump by word, stop at dot?

Postby robert » Thu Dec 24, 2009 5:23 am

When I press ctrl+arrow to jump by word, is it possible to make my RSyntaxTextArea stop at a period? Eg:

Code: Select all
Select all
pg3b.set(true)


The cursor stops at the beginning and before and after each parenthesis. I'd like it to also stop before and after the dot.


Open a bug report on the SourceForge page and I'll see what I can do. This is the default Swing text component behavior. I agree that where it stops when skipping "words" isn't appropriate for moving through code.

As soon as I type the open parenthesis, I get the autocompletion for the get function (which is totally unrelated to the controller's get method!). Is it possible to not automatically popup the autocompletion box if it looks like a method call rather than a function call (ie, it is after a dot)?


I don't have time to look, but I think the "easy" way for you to fix it is this (assuming you're using DefaultCompletionProvider, which I think you are): Create a subclass of DefaultCompletionProvider and override the isValidChar(char) method to something like this:

Code: Select all
@Override
protected boolean isValidChar(char ch) {
   return super.isValidChar(ch) || ch=='.';
}


I think this'll prevent it from popping up the autocomplete window unless you just type "get(". Perhaps this should be the way DefaultCompletionProvider behaves by default? It's really not designed for OO-languages, with methods called on objects, but more for procedural stuff like C (or markup languages). I've got a WIP Java CompletionProvider, that specifically looks for the '.' and attempts to do the "right thing" at all times, and it's believe me, it's not fun. :)

Is font anti aliasing turned off for the RSTA? Can it be turned on? At some font sizes I see some anomalies that bug me. :)


Call setTextAntiAliasHint(String). You pass it the name of the value Object in RenderingHints, not the value itself. I don't remember why it's this way, and perhaps I'll change it to just take the RenderingHints value for the next release. It's just one of those things that makes no sense, but isn't hurting anything so it's been ignored for a long time...

Code: Select all
textArea.setTextAntiAliasHint("VALUE_TEXT_ANTIALIAS_ON");
User avatar
robert
 
Posts: 760
Joined: Sat May 10, 2008 5:16 pm

Re: jump by word, stop at dot?

Postby Guest » Thu Dec 24, 2009 12:12 pm

Bug created. You solved the other two issues, thanks! :)
Guest
 


Return to Help

Who is online

Users browsing this forum: No registered users and 4 guests

cron