CodeMirror.fromTextArea does not honor config.value slot

The fromTextArea() constructor ignores the “value” slot. This is not in the documentation.

The fromTextArea() code I have starts:

  CodeMirror.fromTextArea = function(textarea, options) {
    options = options ? copyObj(options) : {};
    options.value = textarea.value;
    [...]

This is fine, but it would’ve saved me some time if it were documented that way. Or you could change it, either way.

Thanks!

This is documented. The manual states “The text in the textarea will provide the content for the editor.”

Thanks! I’m sorry I missed that, or didn’t realize that it’d override the “value” option. My mistake. I appreciate the quick response!