packages/insomnia-app/app/ui/components/codemirror/code-editor.js
/**
   * Sets the CodeMirror value without triggering the onChange event
   * @param code the code to set in the editor
   * @param forcePrettify
   */
Sets the CodeMirror value without triggering the onChange event
@param code the code to set in the editor
@param forcePrettify
Sets the CodeMirror value without triggering the onChange event @param code the code to set in the editor @param forcePrettify
_codemirrorSetValue(code, forcePrettify = false) {
    if (typeof code !== 'string') {
      console.warn('Code editor was passed non-string value', code);
      return;
    }
    this._originalCode = code;
    if (!forcePrettify) {
      this._ignoreNextChange = true;
    }
    const shouldPrettify = forcePrettify || this.props.autoPrettify;
    if (shouldPrettify && this._canPrettify()) {
      if (CodeEditor._isXML(this.props.mode)) {
        code = this._prettifyXML(code);
      } else if (CodeEditor._isEDN(this.props.mode)) {
        code = CodeEditor._prettifyEDN(code);
      } else {
        code = this._prettifyJSON(code);
      }
    }
    this.codeMirror.setValue(code || '');
  }
_codemirrorSetValue ( code , forcePrettify = false ) { if ( typeof code !== 'string' ) { console . warn ( 'Code editor was passed non-string value' , code ) ; return ; } this . _originalCode = code ; if ( ! forcePrettify ) { this . _ignoreNextChange = true ; } const shouldPrettify = forcePrettify || this . props . autoPrettify ; if ( shouldPrettify && this . _canPrettify ( ) ) { if ( CodeEditor . _isXML ( this . props . mode ) ) { code = this . _prettifyXML ( code ) ; } else if ( CodeEditor . _isEDN ( this . props . mode ) ) { code = CodeEditor . _prettifyEDN ( code ) ; } else { code = this . _prettifyJSON ( code ) ; } } this . codeMirror . setValue ( code || '' ) ; }
Sets the CodeMirror value without triggering the onChange event
 @param code the code to set in the editor
 @param forcePrettify
Sets the CodeMirror value without triggering the onChange event @param code the code to set in the editor @param forcePrettify
// Don't ignore changes from prettify