add check for change to current viewport

This commit is contained in:
Gazook89 committed 2021-11-17 09:47:51 -06:00
1 parent 9f05aae876
commit 8b13528661
2 files changed
+26 -15

No files matched your search

@@ -80,6 +80,7 @@ const CodeEditor = createClass({
// Note: codeMirror passes a copy of itself in this callback. cm === this.codeMirror. Either one works.
this.codeMirror.on('change', (cm)=>{this.props.onChange(cm.getValue());});
this.codeMirror.on('viewportChange', _.debounce((cm)=>{this.props.onChange(cm.getValue());},200));
this.updateSize();
},