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 219879 - templates are not applied in certain contexts
Summary: templates are not applied in certain contexts
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-11 05:50 UTC by akobberup
Modified: 2012-10-18 14:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description akobberup 2012-10-11 05:50:43 UTC
When I type "if" and hit tab, the editor will insert the codetemplate bound to this keyword like this:

if ( true ) {
			
}

When I then after the last curlybrace type in "else if" and then hit tab, I would  expect the editor to look like this:

if ( true ) {
			
} else if ( true ) {
			
}

but it does not. It do not do any inserting of templates for the last "if".



A temp. workaround is to add a code template bound to the abbreviation "elseif" like this:
else if (${EXP instanceof="boolean" default="true"}) {
   ${selection}${cursor}
}

but then i need to write something in the editor that is not completely logical - "elseif" instead of "else if" to make it work.
Comment 1 Jiri Prox 2012-10-11 06:12:42 UTC
reproducible
Comment 2 Dusan Balek 2012-10-18 14:32:54 UTC
Should be fixed in the current dev build.

http://hg.netbeans.org/jet-main/rev/700f40b529cd