I do a lot of Java work, and so I see a lot of code like this:
Classname.methodName();
When I double-click to select a word, I'd prefer to get just one of the words, "Classname" or "methodName" (whichever is double-clicked), but it always selects the whole thing, including the period.
Is there a way to change this behavior in Textpad 4.4.1? I can't find any Preference option for this, nor can I find anything in the syntax def file that relates to this.
I think I recall that this behavior wasn't present in earlier versions of Textpad 4.
Any ideas?
not select period in text...
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: not select period in text...
That should be controlled by Configure/Preferences/Document Class/[JAVA Class]/Syntax ... specifically the "." will be includedin the selection if it's listed in the "Other characters in Words:" *or* it's part of the Keyword characters in the Syntax definition file. This is definitely true in 4.4.0 and should be the same in 4.4.1.
Re: not select period in text...
Correct. In the syntax definition file, if you have any keywords that contain a period, then a period is automatically selected when you double click a word. Just delete all words containing a period from the syntax definition file, or edit them to *not* contain a period.
Re: not select period in text...
thanks, it worked by removing .'s from the syntax file...
I have to say that that's pretty stupid. I can understand it assuming a specific keyword in the list with a . is all one word (although probably it shouldn't be)... but to just assume any words touching a . include the . is not all that intelligent. Personally, I would call this a bug.
Something else that this "fix" appears to have changed is that when I hit the home key, it no longer moves the cursor to the beginning of the text (but after the tabs), but instead now just moves to the true start of the line (column 1).
I have to say that that's pretty stupid. I can understand it assuming a specific keyword in the list with a . is all one word (although probably it shouldn't be)... but to just assume any words touching a . include the . is not all that intelligent. Personally, I would call this a bug.
Something else that this "fix" appears to have changed is that when I hit the home key, it no longer moves the cursor to the beginning of the text (but after the tabs), but instead now just moves to the true start of the line (column 1).
Re: not select period in text...
Since this actually is controlled by the user, with the settings for each document class, i would rather say it's *not* a bug (at all).
I hope you don't consider the home key functionning intuitively is also a bug?
(You can easily make a macro that replaces the cursor the way you describe, and override the default behaviour of the home key.)
HY
I hope you don't consider the home key functionning intuitively is also a bug?

HY
Re: not select period in text...
That's the point... it's not directly controlled... at least not inuitively. It's a by-product of how keywords are defined in syntax files.
The problem with the "." in the syntax file is that if any keyword line has a "." in it (like for Java to denote "Class.Subclass" as a keyword), Textpad then assumes that any "." that touches any word in the working file, even when not defined as a keyword, as part of the word. For example:
If my syntax files lists this:
[Keywords 1]
Class.subclass
Class
Test
Blah.Blah
Then with regards to a line in a source file:
int x = Class.method();
... it assumes that "Class.method" is all one word for selection purposes (double-click on "Class", it selects "Class.method"), even though "Class.method" is not a keyword. This should not be the case. I should define "." in the "Other characters in words" option if I want to have "." as part of words in general. A "." in the keyword list shouldn't mean "assume all '.' as part of words", which is the way 4.4.1 is acting.
The cursor thing doesn't bother me. It's just something I noticed when I took out the "."s from the syntax file... before the change, home moved to the start of text on a line, but after initial tabs, and after, the cursor just moves to the full start of the line. Again, though, that would be a good option.
The problem with the "." in the syntax file is that if any keyword line has a "." in it (like for Java to denote "Class.Subclass" as a keyword), Textpad then assumes that any "." that touches any word in the working file, even when not defined as a keyword, as part of the word. For example:
If my syntax files lists this:
[Keywords 1]
Class.subclass
Class
Test
Blah.Blah
Then with regards to a line in a source file:
int x = Class.method();
... it assumes that "Class.method" is all one word for selection purposes (double-click on "Class", it selects "Class.method"), even though "Class.method" is not a keyword. This should not be the case. I should define "." in the "Other characters in words" option if I want to have "." as part of words in general. A "." in the keyword list shouldn't mean "assume all '.' as part of words", which is the way 4.4.1 is acting.
The cursor thing doesn't bother me. It's just something I noticed when I took out the "."s from the syntax file... before the change, home moved to the start of text on a line, but after initial tabs, and after, the cursor just moves to the full start of the line. Again, though, that would be a good option.
Re: not select period in text...
Bryan,
Your point is well made, so we will address this issue in the next maintenance release.
Keith MacDonald
Helios Software Solutions
Your point is well made, so we will address this issue in the next maintenance release.
Keith MacDonald
Helios Software Solutions