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 237897

Summary: Code template applies also after code completion
Product: editor Reporter: martin.mares
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: markiewb
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description martin.mares 2013-11-01 15:24:50 UTC
I am strong user of code template feature. I map this feature to <SPACE> from the first version with this feature. I update Netbeans regularly and followed problem comes with version 7.4.
I understand that code template on <SPACE> is not default but still possible. I will be very happy if you fix followed bug.

How to reproduce:
SETUP:
- Properties / Editor / Code Templates: Choose Expand template on SPACE
- Be sure that there is followed template in the list:
Abbreviation: le
Expanded text: ${no-indent}length

SIMULATION:
- Open / create any java class.
- Place followed code into any method body:
    String str = "str";
    if (str.
- write: le<ctrl+space>
- choose: length() - It can be choose automatically because it is only one possibility for le
- Your code looks like
    String str = "str";
    if (str.length()
- Write <space> (Because you want to continue with something like ==, ...)
- And your code looks now like:
    String str = "str";
    if (str.lengthlength
- It is because code template was applied even after code completion. And I feel that this is wrong behavior.
Comment 1 Dusan Balek 2015-03-12 09:20:53 UTC
Already fixed in the current dev build.