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 - Macro that inserts quotes, right parenthesis, and semicolon gets extra ); and quotes together in wrong place.
Summary: Macro that inserts quotes, right parenthesis, and semicolon gets extra ); a...
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-16 17:48 UTC by ghbean
Modified: 2016-08-29 06:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (111.14 KB, text/plain)
2013-11-16 17:48 UTC, ghbean
Details

Note You need to log in before you can comment on or make changes to this bug.
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.