0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Remove code added for debugging purposes

#629
This commit is contained in:
Charlie Humphreys
2021-11-10 10:26:55 -06:00
parent 3abb399045
commit c86e8c51cb

View File

@@ -43,10 +43,8 @@ const CodeEditor = createClass({
const newDoc = CodeMirror.Doc(this.props.value, this.props.language);
this.codeMirror.swapDoc(newDoc);
},
getSnapshotBeforeUpdate : function() {
return _.uniq(this.codeMirror.getAllMarks().filter((mark)=>mark.__isFold).map((mark)=>mark.find().from));
},
componentDidUpdate : function(prevProps, prevState, snapshot) {
componentDidUpdate : function(prevProps) {
if(prevProps.view !== this.props.view){ //view changed; swap documents
let newDoc;
@@ -66,12 +64,6 @@ const CodeEditor = createClass({
} else if(this.codeMirror?.getValue() != this.props.value) { //update editor contents if brew.text is changed from outside
this.codeMirror.setValue(this.props.value);
}
setTimeout(()=>{
snapshot.forEach((fold)=>{
this.codeMirror.foldCode(fold, { scanUp: false }, 'fold');
});
}, 0);
},
buildEditor : function() {