@@ -18,6 +18,7 @@ const CodeMirror = createReactClass({
1818 codeMirrorInstance : PropTypes . func ,
1919 defaultValue : PropTypes . string ,
2020 onChange : PropTypes . func ,
21+ onCursorActivity : PropTypes . func ,
2122 onFocusChange : PropTypes . func ,
2223 onScroll : PropTypes . func ,
2324 options : PropTypes . object ,
@@ -46,6 +47,7 @@ const CodeMirror = createReactClass({
4647 const codeMirrorInstance = this . getCodeMirrorInstance ( ) ;
4748 this . codeMirror = codeMirrorInstance . fromTextArea ( textareaNode , this . props . options ) ;
4849 this . codeMirror . on ( 'change' , this . codemirrorValueChanged ) ;
50+ this . codeMirror . on ( 'cursorActivity' , this . cursorActivity ) ;
4951 this . codeMirror . on ( 'focus' , this . focusChanged . bind ( this , true ) ) ;
5052 this . codeMirror . on ( 'blur' , this . focusChanged . bind ( this , false ) ) ;
5153 this . codeMirror . on ( 'scroll' , this . scrollChanged ) ;
@@ -95,6 +97,9 @@ const CodeMirror = createReactClass({
9597 } ) ;
9698 this . props . onFocusChange && this . props . onFocusChange ( focused ) ;
9799 } ,
100+ cursorActivity ( cm ) {
101+ this . props . onCursorActivity && this . props . onCursorActivity ( cm ) ;
102+ } ,
98103 scrollChanged ( cm ) {
99104 this . props . onScroll && this . props . onScroll ( cm . getScrollInfo ( ) ) ;
100105 } ,
0 commit comments