File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,9 @@ var CodeMirror = (function() {
460460 return getRange ( sel . from , sel . to ) ;
461461 }
462462
463+ var pollingFast = false ; // Ensures slowPoll doesn't cancel fastPoll
463464 function slowPoll ( ) {
465+ if ( pollingFast ) return ;
464466 poll . set ( 2000 , function ( ) {
465467 startOperation ( ) ;
466468 readInput ( ) ;
@@ -470,12 +472,13 @@ var CodeMirror = (function() {
470472 }
471473 function fastPoll ( keyId ) {
472474 var missed = false ;
475+ pollingFast = true ;
473476 function p ( ) {
474477 startOperation ( ) ;
475478 var changed = readInput ( ) ;
476479 if ( changed == "moved" && keyId ) movementKeys [ keyId ] = true ;
477480 if ( ! changed && ! missed ) { missed = true ; poll . set ( 80 , p ) ; }
478- else slowPoll ( ) ;
481+ else { pollingFast = false ; slowPoll ( ) ; }
479482 endOperation ( ) ;
480483 }
481484 poll . set ( 20 , p ) ;
You can’t perform that action at this time.
0 commit comments