[2.2] Change focus responsability to codemirror events.

Seems to work as expected. Let's pull it in.