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 38373 - ; typed when the next character is ) should put a ; at the end of the line
Summary: ; typed when the next character is ) should put a ; at the end of the line
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-04 06:22 UTC by _ tboudreau
Modified: 2007-11-05 13:44 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 _ tboudreau 2004-01-04 06:22:15 UTC
We now have the cool new editor features with
opening and closing parenthesis.

There's one thing that drives me nuts, and could
be fixed to really make the functionality perfect:

Often I am typing something like:

int a = getA()

The problem is, I get the completion, but I still
have to lift my hand off the keyboard and press
the right arrow button to go to the end of the
line to enter the ;.  It kills half of the
convenience of this feature.

But thinking about it, all you'd have to do is
make typing a ; when the character after the caret
is ), and it would work perfectly and intuitively.

The only place I can think of where it is common
to mix ;'s and ) in mid line is for-next loop
declarations.  And it's an extremely rare use case
to enter

 for (int i=0; i++;;)

or something like that...I wouldn't worry about
it, but if you wanted to, you just have to scan
the current line for " for " preceding the caret -
not a lot of work.

Any chance we could do this for 3.6?
Comment 1 _ tboudreau 2004-01-13 15:52:30 UTC
Changing status to defect - I find I am still typing )'s even though they are inserted by 
the editor for me - because I have to get to the end of the line to type the ;.  That 
defeats half the usefulness of the editor inserting () for me.
Comment 2 _ tboudreau 2004-01-13 15:53:31 UTC
BTW when looking at another issue I noticed that our Java syntax support has a 
method specifically for determining if a ; belongs to a for loop, so detecting that 
should be trivial.
Comment 3 Martin Roskanin 2004-01-23 15:02:51 UTC
We will try to fix it to NB 3.6
Comment 4 Dusan Balek 2004-01-30 11:48:31 UTC
Fixed in [maintrunk].

/cvs/editor/src/org/netbeans/modules/editor/java/BracketCompletion.java,v
 <--  BracketCompletion.java
new revision: 1.9; previous revision: 1.8
done
Comment 5 pfelenda 2004-02-06 11:30:44 UTC
Is there any UI specification describing this feature ?
How should it works in other cases ?

int a = getMyObject().getA()

I have a suggestion :
It should works in conjuction with "Start New Line" feature. ( see
http://ui.netbeans.org/docs/hi/promoB/2xEnter.html )
int a = getA(|)   // shift+Enter should add the ";" at end of line and
move caret to next line (on condition that the ";" is not pressent)




Comment 6 _ tboudreau 2004-02-06 11:50:57 UTC
Well, please don't remove the feature!  It is quite useful!  (Now I just have to retrain my 
fingers to not type )'s over the )'s that were inserted for me so I can put in the ;...)
Comment 7 Jiri Prox 2006-04-07 09:06:55 UTC
Verified