Handle code completion correctly with auto close braces on.
A better fix suggested from Randy's code review.
Merge pull request #6936 from adobe/rlim/enter-key-issue

Handle code completion correctly with auto close braces on.