Tracker: Feature Requests

5 Insertion of closing curly brace on Enter keypress - ID: 2715095
Last Update: Settings changed ( robert_futrell )

While RSTA currently has a decent auto-indentation engine that knows to indent when going to a line after an opening curly brace '{', it would be nice to also be able to automatically insert the closing curly brace '}'.

The gotcha is that you can't simply insert it each time they press Enter and the last token on the line is '{', as then they would get an extra '}' each time they did so. Eclipse seems to "just know" when to add the closing brace or whether it's already been inserted - I imagine it's parsed your source and knows the curly braces up to that point all match up.

We could set a flag when '{' is typed, and only insert the closing brace if '{' is immediately followed by Enter (no key presses in between). This might be a fair solution that works in almost all daliy use.

Or maybe this isn't a big deal at all. Maybe we should always insert a closing brace on Enter after a '{'. If a user goes up and presses Enter over and over, it's their own fault for getting too many curly braces...

Opinions are welcome!


Robert Futrell ( robert_futrell ) - 2009-03-26 11:27:33 PDT

5

Closed

None

Robert Futrell

None

None

Public


Comments ( 2 )

Date: 2009-12-01 21:26:37 PST
Sender: robert_futrellProject Admin

Added in 1.4.0.


Date: 2009-08-24 16:13:12 PDT
Sender: robert_futrellProject Admin

Pushed to SVN in revision 124. Will be in the next "official" release.


Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
status_id Pending 2009-12-01 21:26:38 PST robert_futrell
allow_comments 1 2009-12-01 21:26:38 PST robert_futrell
close_date 2009-08-24 16:13 2009-12-01 21:26:38 PST robert_futrell
status_id Open 2009-08-24 16:13:14 PDT robert_futrell
close_date - 2009-08-24 16:13:14 PDT robert_futrell