codemirror not changed when window changed, solve this bug