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 238463

Summary: Macro that inserts quotes, right parenthesis, and semicolon gets extra ); and quotes together in wrong place.
Product: php Reporter: ghbean <ghbean>
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

Description ghbean 2013-11-16 17:48:24 UTC
Product Version = NetBeans IDE 7.4 (Build 201310111528)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) Client VM 23.25-b01

A macro that has been working since at least 2009 generates incorrect code. 
The macro:
select-identifier  copy-to-clipboard caret-end-line insert-break "dmpf_var("paste-from-clipboard " , '" delete-next paste-from-clipboard  last-non-white "');"

Has different results with different settings of Tools->Options->Editor->Code Completion. 
No setting give correct results. 
The following php code snippet show the results with settings that seemed to change result.

<?php
/* Expected result with 
 *  Cursor after $v
 */
$var1 = 0;
dmpf_var($var1 , '$var1');
$var2 = 1;


 /*
  *   Tools->Options->Editor->Code Completion - All Languages: Insert Closing Brackets Automatically checked
  *  Tools->Options->Editor->Code Completion - PHP : All Variables checked 
  *  Cursor after $v 
  */
$var1 = 0;
dmpf_var($var1 , '$var');1
$var2 = 1;

 /*  Tools->Options->Editor->Code Completion - All Languages:  everything unchecked
  *  Tools->Options->Editor->Code Completion - PHP : All Variables checked 
  *  Cursor after $v
  */
$var1 = 0;
dmpf_var($var1 , '$var1$var2 = 1');;

/*  Tools->Options->Editor->Code Completion - All Languages:  everything unchecked
  *  Tools->Options->Editor->Code Completion - PHP : All Variables and Use Smat Quotes,  checked 
  *  Cursor after $v
 */
$var1 = 0;
dmpf_var($var1 , $var');1
$var2 = 1;
        
        
 '/*  Tools->Options->Editor->Code Completion - All Languages:  Insert Closing Brackets Automatically checked
  *  Tools->Options->Editor->Code Completion - PHP : All Variables and Use Smat Quotes,  checked 
  *  Cursor after $v
 */
$var1 = 0;
dmpf_var($var1 , $var1');')
$var2 = 1;
Comment 1 ghbean 2013-11-16 17:48:28 UTC
Created attachment 142268 [details]
IDE log
Comment 2 Svata Dedic 2014-07-15 07:30:07 UTC
The issue is caused by PhpDeletedTextInterceptor - possibly some change there. When the macro performs delete-next action in an attempt to delete a closing quote, the interceptor deletes also the matching opening quote.