Fix for syntaxMode.

Also, recreate the editor on each attach.