-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Currently when you edit and you press "left parenthesis", the tool adds "right parenthesis". This makes sense in some contexts, but it's annoying in others - in many cases you are certain to need to delete the right parenthesis, and their insertion is more trouble than help.
I think using them should be an editor setting (on/off), so if you hate them they stop getting added.
If it's on, it'd be nice if they were inserted using a smarter algorithm. Here's a simple one (algorithm 1):
Insert the matching closing "paren" after the opening if the expression is at the end or the expression is followed by a closing "paren-like" symbol.
Algorithm 1 is at least simple to simple to implement.
Another algorithm (algorithm 2) would be:
only add the right paren after the left one if the whole statement would be syntactically valid (once the "(...)" expression was completed).
However, this second one is complicated, I'm not sure how to do that quickly & I doubt it's worth the trouble.