@@ -76,8 +76,8 @@ var CodeMirror = (function() {
7676 // Register our event handlers.
7777 connect ( wrapper , "mousedown" , operation ( onMouseDown ) ) ;
7878 connect ( code , "dblclick" , operation ( onDblClick ) ) ;
79- connect ( wrapper , "scroll" , function ( ) { updateDisplay ( ) ; if ( options . onScroll ) options . onScroll ( instance ) ; } ) ;
80- connect ( window , "resize" , updateDisplay ) ;
79+ connect ( wrapper , "scroll" , function ( ) { updateDisplay ( [ ] ) ; if ( options . onScroll ) options . onScroll ( instance ) ; } ) ;
80+ connect ( window , "resize" , function ( ) { updateDisplay ( true ) ; } ) ;
8181 connect ( input , "keyup" , operation ( onKeyUp ) ) ;
8282 connect ( input , "keydown" , operation ( onKeyDown ) ) ;
8383 connect ( input , "keypress" , onKeyPress ) ;
@@ -160,7 +160,7 @@ var CodeMirror = (function() {
160160 getRange : function ( from , to ) { return getRange ( clipPos ( from ) , clipPos ( to ) ) ; } ,
161161
162162 operation : function ( f ) { return operation ( f ) ( ) ; } ,
163- refresh : function ( ) { updateDisplay ( [ { from : 0 , to : lines . length } ] ) ; } ,
163+ refresh : function ( ) { updateDisplay ( true ) ; } ,
164164 getInputField : function ( ) { return input ; } ,
165165 getWrapperElement : function ( ) { return wrapper ; }
166166 } ;
@@ -598,8 +598,8 @@ var CodeMirror = (function() {
598598 if ( ! wrapper . clientWidth ) return ;
599599 // First create a range of theoretically intact lines, and punch
600600 // holes in that using the change info.
601- var intact = [ { from : showingFrom , to : showingTo , domStart : 0 } ] ;
602- for ( var i = 0 , l = changes ? changes . length : 0 ; i < l ; ++ i ) {
601+ var intact = changes === true ? [ ] : [ { from : showingFrom , to : showingTo , domStart : 0 } ] ;
602+ for ( var i = 0 , l = changes . length || 0 ; i < l ; ++ i ) {
603603 var change = changes [ i ] , intact2 = [ ] , diff = change . diff || 0 ;
604604 for ( var j = 0 , l2 = intact . length ; j < l2 ; ++ j ) {
605605 var range = intact [ j ] ;
0 commit comments