This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 185469 - Double click on a word ending with a \ in a string also selects the backslash
Summary: Double click on a word ending with a \ in a string also selects the backslash
Status: RESOLVED DUPLICATE of bug 231075
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Ondrej Brejla
: 197319 (view as bug list)
Depends on:
Reported: 2010-05-05 04:11 UTC by paolosca
Modified: 2013-06-11 10:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description paolosca 2010-05-05 04:11:22 UTC
Since a few builds ago, when I double click on a word in a string, if there is a backslash at the end it is also included in the selection. 
This happens also with ctrl+shift+right.


$foo = "\"bar\"";

double clicking on bar used to select only bar but now it selects $bar\

Product Version = NetBeans IDE Dev (Build 201005030200)
Operating System = Linux version 2.6.32-5-686 running on i386
Java; VM; Vendor = 1.6.0_20
Runtime = Java HotSpot(TM) Client VM 16.3-b01
Comment 1 paolosca 2010-08-30 04:58:27 UTC
Hi... Are there any news about this bug? I'm now working on third party code which has lots of variables embedded within strings and it's very annoying when I need to past and copy.


print("<div id=\"$bar\">");

Double clicking on the variable $bar selects $bar\, ctrl+shift+right also has the same effect.

The only way to select the variable is to place the caret before $, hold down the shift key then keep hitting right until the variable name is completely selected.

I'm pretty sure it wasn't working in this way in NB 6.8, but I can't recall exactly when the behavior changed.

Comment 2 Filip Zamboj 2010-09-15 12:31:24 UTC
batch reassigning
Comment 3 paolosca 2011-04-04 18:03:31 UTC
Any chances to have this fixed for 7.0?

I noticed that in other languages, escaped characters in strings are handled correctly.

In example double-clicking on the word test in the following string in a javascript file just selects test

x = "test\n";

By contrast, in php double-clicking on the word test the following string selects test\n

$x = "test\n";

Even more inconsistent is the behaviour when escaped " or ' are in the string, in the followings case clicking on the word test selects test\ 

$x = "test\"";
$x = 'test\'';

Languages where I noticed escape characters are handled correctly are javascript, SQL, C and Java. In all of them double-clicking test on any of the following cases just selects test:
x = 'test\n'
x = 'test\''

Also, in Javascript and C escaped characters as \n are nicely displayed in bold which makes an easy reading in strings.


Comment 4 Tomas Mysik 2011-04-05 10:37:29 UTC
For 7.0 FCS too late, but maybe be for the next minor version?

Comment 5 Petr Pisl 2011-04-05 12:51:33 UTC
This is basically regression of the fix #185183. I have to find out solution than will work for both issues.
Comment 6 paolosca 2011-09-21 05:24:05 UTC
Sorry, misunderstood the use of the Version field, reverting to the original
Comment 7 Petr Pisl 2011-09-26 13:28:25 UTC
Still valid. I was playing with this and looking for a solution. The problem now is that there is missing a suitable api, that should alter the world selection based on a context. Now it based only on char outside a contex, so I can only say, this char belongs to a word, this is word delimiter. But solving the problem is more complected.
Comment 8 Petr Pisl 2011-09-29 13:05:50 UTC
*** Bug 197319 has been marked as a duplicate of this bug. ***
Comment 9 Ondrej Brejla 2013-06-11 10:14:35 UTC

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