codemirror character width calculation fix