Menu

#938 Insertion of braces

open
nobody
None
1
2015-11-12
2015-11-12
Anonymous
No

The following behavior is standard in many good editors/IDEs: When the character right to the cursor is already a closing brace, then the editor should insert a typed closing brace only, if it would not invalidate the brace balance.

Assume the following situation, where I have used the sqrt template that inserted braces automatically for me. That leaves me with

$\sqrt{arg|}$

where the cursor is at the | bar. When I now type a closing } it gets inserted which leaves me in an invalid state with two }} at the end. The standard behavior of the editor is to insert pairs of braces as often as possible is good, because it helps you to write balanced braces. Now, you need to take this a step forward and preventing the user from inserting wrong closing braces.

This kind of scheme is used e.g. in IntelliJ IDEA for years and it is very convenient.

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB