Fix position converter in codemirror