Hi developers,

I am using the automatical parentheses completement function.  I found that when the parentheses environment is complex, there are often some errors. To concrete, in the case that there have been many parentheses loops, if you input another curly brace pair in the deep middle, the right-side pair of braces cannot be created automatically. Please check and fix. Thanks.

Take care,