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.
Product Version = NetBeans IDE 7.1 (Build 201112071828) Operating System = Linux version 3.0.0-14-generic-pae running on i386 Java; VM; Vendor = 1.6.0_23 Runtime = OpenJDK Client VM 20.0-b11 Example: <?php $a = 'fred'; $a = "fred"; ?> Use mouse to highlight 'fred' or "fred" (including the quotes) If the next character typed is: 1. A non-quote character: Highlighted text is replaced (expected behavior); 2. A different quote character than the one enclosing the text: Both existing quotes are changed to the character typed (design feature?); or 3 The same quote character as the one enclosing the text: The new character is appended. Case 3. is frustrating me every time I try to replace a quoted text with another. Is there a use-case to justify this behavior? If so then the answer is to only highlight the text within quotes. But I for one so often just grab the whole text incl quotes and then consider what is to be typed there whether it be a variable, double quoted text or single quoted text etc.
It seems to be a bug, I'm not sure what was the purpose of this behavior ;) But it can be simply workarounded, if you just want to rewrite the content of quotes...double-click on text, or mark it by mouse...and write what you need. Thanks for your report!
Actually it is worse than my original post: Highlighting ANY TEXT in php code and typing a quote encloses that text with quotes and places the cursor after the closing quote. Same behaviour for single and double quote, but not back-tick. I can find no option to disable this 'feature' :( So any time you want to replace something with quoted text you must first delete existing text before typing the new text.
I found disabling Options->Editor->CodeCompletion->InsertClosingBracketsAutomatically makes this problem (and a couple of others) go away. Editor trying to be too clever for it's own good.
I've implemented some new feature which allows you to disable "magic" quotes behavior. It's described here http://netbeans.org/bugzilla/show_bug.cgi?id=188774#c12 *** This bug has been marked as a duplicate of bug 188774 ***