User Interface Specification:
"Smart Brackets"
Author: Gabriel Tichy
$Revision: 1.2 $
- Table of Contents:
Introduction
The user often writes a code that has opening and closing brackets, and this
is very often source of compilation errors. If the IDE would insert a closing
bracket each time opening bracket is typed, the likelihood of error is smaller,
and the user also has a better visualization of the structure.
Detailed Specification
Smart Pairs
When the user types a character which needs a closing pair, the IDE will automatically
put this closing pair right after current insertion point. However, if the user
continues typing and put also the closing pair (that is already typed), IDE
should detect that and lets put only the one instance.
This should work vice versa too, i.e. when user is deleting opening pair, the
closing pair should be deleted automatically as well (only when no other characters
are present between these two).
Characters for which the automatic completion of closing pairs is supported:
| Square Brackets: |
[ ] |
| Parenthesis: |
( ) |
| Single Quotes: |
' ' |
| Double Quotes: |
" " |
Smart Brace
In case of braces, user have to press Enter right after the opening brace. Then,
a new line is insterted along with the line containing the closing brace.
Before Enter

After Enter

- identation for the new line works as usually
- closing brace is added on the next line, indented as the original statement
- if (already placed) closing brace is recognized, only new line is added
Undo
Undo is working exactly in the opposite direction for all of these.
Options
Option to turn on/off inserting of closing braces and other characters is placed
under Editor Settings in Expert properties:
- Name: Pair Character Completion
- Values: boolean (checkbox component)