Fixes for weird CodeMirror behaviours at specific window widths.

Signed-off-by: Grant Skinner <info@gskinner.com>