Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327874

Summary: [navigation] Double click word in editor selects word differently depending on whether it is comment or not
Product: [Eclipse Project] Platform Reporter: Andrey Grigoriev <f0r_spam>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert, mikhail.barg, remy.suen
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Andrey Grigoriev CLA 2010-10-15 06:34:17 EDT
Build Identifier: M20100909-0800

Double clicking a word in editor usually selects that word, but when this word is inside a comment (Java or C++) some additional characters may become selected.

Reproducible: Always

Steps to Reproduce:
1. Open a Java or C++ editor
2. Type or copy-paste following text there:

whatever = object.method();
// somethingElse = anotherObject.method();

3. Double-click "object" word. Notice that selection ends before dot.
4. Double-click "anotherObject" word. Notice that in this case selection ends before opening parenthesis.
Comment 1 Andrey Grigoriev CLA 2010-10-15 06:41:37 EDT
The same will happen if you put the colon (one or more) instead of the dot before "method()", but will not happen if you put a comma there.

In all scenarios selection should end at word break (i.e. how it works outside of comment).
Comment 2 Mikhail Barg CLA 2010-10-15 08:15:33 EDT
The same strange behavior is observed in the regular text editor: the "." symbol is ignored.

Even more strange: 

1. Open standard text editor
2. Type or copy-paste following text there:

abc.123
abc.cde

3. Double-click "abc" on the first line. Notice that the "abc" is selected.
4. Double-click "abc" on the second line. Notice that whole line "abc.cde" is selected.

Also notice that spell checker marks "abc" on the first line as an error (underlines with red), while ignores it on the second line.
Even more. While I type this via mylin editor, I see that these two lines are displayed in different font.

It seems to me that the editor recognize the second line to be a "code" or something like this. The behavior seem to be unclear and unexpected..
Comment 3 Remy Suen CLA 2010-10-15 08:17:36 EDT
Issues and concerns with Eclipse's text editor goes to Platform/Text.

Please see bug 285957.
Comment 4 Dani Megert CLA 2010-10-15 09:20:50 EDT

*** This bug has been marked as a duplicate of bug 285957 ***