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 57856 - Expand Abbreviations [abbrev-expand] should not work based on immidiate history of typed chars
Summary: Expand Abbreviations [abbrev-expand] should not work based on immidiate histo...
Status: RESOLVED DUPLICATE of bug 151633
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker with 2 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-13 23:38 UTC by _ sandipchitale
Modified: 2011-09-19 20:53 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 _ sandipchitale 2005-04-13 23:38:05 UTC
Expand Abbreviations [abbrev-expand] works only if the immidiate preceding 
chars match an abbrev.

Here is the scenario:

I bound a key stroke (Ctrl+Enter) to Expand Abbreviations [abbrev-expand]  
action in Java editor key bindings options.

I have an abbrev:

foria

which should expand to:

for (int i = 0; i < |.length; i ++) {
}

Now when I type:

foria<SPACE>

the abbreviation expands correctly. This seems to be an implicit key binding.

foria<Ctrl+Enter>

the abbreviation expands correctly too.

However if I type any char like backspace (say to correct a spelling mistake) 
then the abbrev expansion does not work e.g.

foris<BACKSPACE>a<Ctrl+Enter>

then the abbreviation does not expand.

I think the Expand Abbreviations [abbrev-expand] should work as long as the 
text (word?) before the caret matches  an abbreviation.

The following method could be used to find the prefix at the current offset 
position:

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/Utilities.html#getPrev
iousWord(javax.swing.text.JTextComponent,%20int)
Comment 1 _ sandipchitale 2007-11-19 19:20:12 UTC
The Edit:Expand Template action (Ctrl+J SPACE is the default keybinding on windows and linux) of Code Template Tools
module (http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=1157) works like the proposed
enhancement.
Comment 2 Vitezslav Stejskal 2008-10-29 13:02:31 UTC
*** Issue 121198 has been marked as a duplicate of this issue. ***
Comment 3 Vitezslav Stejskal 2008-10-29 13:02:45 UTC
*** Issue 144201 has been marked as a duplicate of this issue. ***
Comment 4 Vitezslav Stejskal 2008-10-29 13:03:03 UTC
*** Issue 151633 has been marked as a duplicate of this issue. ***
Comment 5 ceklock 2011-09-19 20:53:04 UTC

*** This bug has been marked as a duplicate of bug 151633 ***