File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -604,7 +604,7 @@ var CodeMirror = (function() {
604604
605605 function visibleLines ( ) {
606606 var lh = lineHeight ( ) , top = wrapper . scrollTop - paddingTop ( ) ;
607- return { from : Math . max ( 0 , Math . floor ( top / lh ) ) ,
607+ return { from : Math . min ( lines . length , Math . max ( 0 , Math . floor ( top / lh ) ) ) ,
608608 to : Math . min ( lines . length , Math . ceil ( ( top + wrapper . clientHeight ) / lh ) ) } ;
609609 }
610610 // Uses a set of changes plus the current scroll position to
@@ -1043,7 +1043,7 @@ var CodeMirror = (function() {
10431043 function lineHeight ( ) {
10441044 var nlines = lineDiv . childNodes . length ;
10451045 if ( nlines ) return lineDiv . offsetHeight / nlines ;
1046- else return measure . offsetHeight || 1 ;
1046+ else return measure . firstChild . offsetHeight || 1 ;
10471047 }
10481048 function charWidth ( ) { return ( measure . firstChild . offsetWidth || 320 ) / 40 ; }
10491049 function paddingTop ( ) { return lineSpace . offsetTop ; }
You can’t perform that action at this time.
0 commit comments