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 114921 - ruby code templates don't expand if you retype part of them
Summary: ruby code templates don't expand if you retype part of them
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@ruby
Depends on:
Reported: 2007-09-06 17:11 UTC by jamespb
Modified: 2012-11-29 18:07 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description jamespb 2007-09-06 17:11:18 UTC
doc<backspace>c<tab> - the expansion for the 'doc' template doesn't happen.
Comment 1 jamespb 2007-09-06 17:12:49 UTC
Product Version: NetBeans Ruby IDE 070906 Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 System: Windows Vista
version 6.0 running on x86; Cp1252; en_US (nbrubyide) Userdir: C:\Users\James\AppData\Roaming\.nbrubyide\dev
Comment 2 Jiri Skrivanek 2007-09-07 08:20:31 UTC
It is as designed. The expansion happens only if you type an abbreviation "without interruption".
Comment 3 jamespb 2007-09-08 18:45:50 UTC
I posted this to and got back the following, so I'm reopening.

it's true that this was by design, but I think it was designed that
way a long time ago when abbreviations worked differently.

Until NetBeans 6.0, abbreviations expanded when you typed the spacebar!

Sometimes you would "accidentally" expand a template if you happened
to choose a variable that had a corresponding code template name. For
example, "df" would expand to "default", so once when I tried to
write "DocumentFragment df = " I would end up with "DocumentFragment
default = ".

I think the reason the code template behavior was designed to reset
itself if you were just editing an existing string as opposed to
typing it out, was to make it easier to "fix" source. If in the above
I ended up with "default" and I backspaced to edit it back to "df"
again, I wouldn't want pressing space again to change things back to

For a while, the change to Tab was a bit controversial, but I think
people have gotten comfortable with it. And given that Tab is now an
explicit "expand me" key, I think changing the behavior to look at
the source contents rather than the keystroke history is a good
change. Yes, people can still change the expansion key back to space
- but if I do that, I think they should be willing to live with the
new expansion behavior.

-- Tor
Comment 4 Vitezslav Stejskal 2007-09-11 09:30:03 UTC
Ok, let's treat it as RFE since it really works as designed, even though I agree that the design as a little bit
obsolete now. IMO we should allow a user to say when they want the expansion to happen and the default value for this
setting could be different for TAB and SPACE expansion keys:

TAB - always expand
SPACE - expand when typed at once