Change focus responsability to codemirror events.
Merge pull request #3039 from oskarhane/fix_focus_responsability

[2.2] Change focus responsibility to codemirror events.