code: function(e) {
      if (this.props.parameters.autoIndent) {
        var state = this.state.state;
        var selection = state.getSelection();
  
        var indentationLevel = indentationLevelAt(state.getCurrentContent(),
                                                  selection.getFocusKey(),
                                                  selection.getFocusOffset());
  
        if (state.getCurrentContent().getBlockForKey(selection.getFocusKey())
                 .getText().substr(selection.getFocusOffset())
                 .trim().startsWith("}")) {
          indentationLevel--;
        }
  
        state = EditorState.push(
            state,
            this._insertLineAfter(state.getCurrentContent(),
              selection,
              this._generateIndentation(indentationLevel)),
            "inserted-text"
            );
  
        this.setState({state: state});
  
        return "handled";
      } else {
        return "not-handled";
      }
    }
docs: Handles the return (Enter) key if autoindent is enabled.