Use `CodeMirror.Pos` for this.