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 242789 - Expanding code template doesnt work inside another active code template
Summary: Expanding code template doesnt work inside another active code template
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal with 5 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 245264 247147 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-11 11:24 UTC by icaine
Modified: 2016-07-07 07:29 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description icaine 2014-03-11 11:24:49 UTC
When i try expand code template (CT) inside another code template via TAB, jumping to next variable occurs instead of inner CT expansion..

See http://i.imgur.com/enccV82.png (i have CT "this" which expands to "$this->")

I have noticed this behaviour since 7.4 and its present in 8.0rc as well
Comment 1 Ondrej Brejla 2014-04-25 09:40:21 UTC
Doesn't work in Java either, probably some general problem?
Comment 2 Dusan Balek 2014-04-25 17:19:15 UTC
Unfortunately, this is as designed behavior. See issue #240327.
Comment 3 icaine 2014-04-25 19:31:01 UTC
Well, for the other one its desired behaviour, for me (as PHP developer) its very annoying and undesirable behaviour. Seems like there should be an option how to deal with CT inside another CT when expand key is pressed. Maybe there should be even per template option like "can expand inside another template" resp. "do not expand inner templates".
Comment 4 Dusan Balek 2014-04-28 06:34:27 UTC
OK. Marking as a possible enhancement for the next release.
Comment 5 vvoody 2014-06-17 13:44:38 UTC
That was painfull months for me with 8.0. This feature makes me downgrade back to 7.4 :( 

Im using lot of "t" => "$this->" CT like icaine. In "if" CT is only one variable so there is TAB totaly useles befor I hit ESC (ESC is uncofortably on corner of keyboard). After finishing if condition in 7.4 I just need hit enter (pretty confortably on right pinky without mooving hand) once or twice to finish CT and cursor is on right spot inside if block. In 8.0 I need to interupt "if" CT with ESC so theres no user for enter after finishing condition, need move hand closer to arrow keys, hit down key and back adjust hand to right place on keyboard.

It looks like silly problem but CT and autocomplete can save lot of time while typing and not making typos.

One solution should be option, like icaine said. Another solutions should be not allow inner CT expand only immediately after CT expand.

Btw, if variable in CT is abbeviation of another CT thats imo bad design of CTs ;)
Comment 6 icaine 2014-06-17 16:30:12 UTC
It's damnly frustrating behaviour, i partially bypassed it with AutoHotkey's hotstrings, but because of one guy had a problem with template named "n" that could be easily changed to "nn", we have to hit espace key like tens time a day since we cannot change the behaviour at all..

Another template i use is "fncc" for inserting closure function definiton and its just #%^@#*$ to have to hit escape every time after i use code comletation because otherwise TAB would just jump the cursor to another parameter..
Comment 7 Jiri Prox 2014-06-26 13:35:54 UTC
*** Bug 245264 has been marked as a duplicate of this bug. ***
Comment 8 Jiri Prox 2014-09-16 14:24:43 UTC
*** Bug 247147 has been marked as a duplicate of this bug. ***
Comment 9 honza.hubeny 2014-09-17 07:17:49 UTC
(In reply to Dusan Balek from comment #4)
> OK. Marking as a possible enhancement for the next release.

This "feature" - issue #240327 is the most annoying change in netbeans until 5.5. 

I use netbeans only for java development. Our use case which was destroyed as with this feature is described in duplicate bug 247147.
Comment 10 Martin Balin 2016-07-07 07:29:51 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss