refresh codemirror when tab is shown to close #509