How do I use the refresh function from CodeMirror 2?
refresh()
If your code does something to change the size of t
When you instantiate the CodeMirror instance, it is placed as a property on the wrapper div.
$('.CodeMirror').each(function(i, el){
el.CodeMirror.refresh();
});
The above snippet does not recreate the editor, but instead uses the existing one.
The refresh method (just like all other CodeMirror methods) does not live on the DOM node, but on the instance object that's returned when you create the editor (by calling CodeMirror or CodeMirror.fromTextArea). So you'll have to store those somewhere for this to work.