Auto-close brackets is when you type an opening bracket (which are parenthesis "(", curly braces "{" or square brackets "[") a closing companion is automatically inserted for you.
The current way this is handled by PhpED is to add them and not skip over them if you happen to type the closing bracket. This leads to doubling the number of brackets, and in some cases, having confusing code for a moment. As an example:
If you type the following in PhpED:
$array = array( 1=>array('test'=>'this is a test'), 2=>array('this is a test')); |
The closing parenthesis will be generated by PhpED; however, you have to use the arrow keys to skip over the character, or use your mouse. If you were to continually type without leaving your keyboard, and included the closing braces, your code would look like this:
$array = array( 1=>array('test'=>'this is a test'), 2=array('this is a test'));))) |
Please participate in the poll casting a vote on how you'd like the feature to work. I'll try and explain each below:
Print the bracket, skip over when you type the closing bracket
While typing, if you type the closing bracket, if the character to the right of the cursor is the same bracket, skip over it.
Just print the bracket, use a hot-key combo to skip the closing bracket(s)
While typing, once you're ready to skip past the auto-closed brackets, use a hot-key combo like shift+alt+s (or something) to skip the auto-closed brackets.
Print the bracket, don't skip
This is the current way PhpED acts.