@@ -213,7 +213,7 @@ window.CodeMirror = (function() {
213
213
estimateLineHeights ( cm ) ;
214
214
regChange ( cm ) ;
215
215
clearCaches ( cm ) ;
216
- setTimeout ( function ( ) { updateScrollbars ( cm . display , cm . doc . height , cm . options . fixedGutter ) ; } , 100 ) ;
216
+ setTimeout ( function ( ) { updateScrollbars ( cm ) ; } , 100 ) ;
217
217
}
218
218
219
219
function estimateHeight ( cm ) {
@@ -251,6 +251,7 @@ window.CodeMirror = (function() {
251
251
252
252
function guttersChanged ( cm ) {
253
253
updateGutters ( cm ) ;
254
+ alignHorizontally ( cm ) ;
254
255
regChange ( cm ) ;
255
256
}
256
257
@@ -318,7 +319,8 @@ window.CodeMirror = (function() {
318
319
319
320
// Re-synchronize the fake scrollbars with the actual size of the
320
321
// content. Optionally force a scrollTop.
321
- function updateScrollbars ( d /* display */ , docHeight , fixedGutter ) {
322
+ function updateScrollbars ( cm ) {
323
+ var d = cm . display , docHeight = cm . doc . height ;
322
324
var totalHeight = docHeight + paddingVert ( d ) ;
323
325
d . sizer . style . minHeight = d . heightForcer . style . top = totalHeight + "px" ;
324
326
var scrollHeight = Math . max ( totalHeight , d . scroller . scrollHeight ) ;
@@ -340,7 +342,7 @@ window.CodeMirror = (function() {
340
342
d . scrollbarFiller . style . display = "block" ;
341
343
d . scrollbarFiller . style . height = d . scrollbarFiller . style . width = scrollbarWidth ( d . measure ) + "px" ;
342
344
} else d . scrollbarFiller . style . display = "" ;
343
- if ( needsH && fixedGutter ) {
345
+ if ( needsH && cm . options . coverGutterNextToScrollbar && cm . options . fixedGutter ) {
344
346
d . gutterFiller . style . display = "block" ;
345
347
d . gutterFiller . style . height = scrollbarWidth ( d . measure ) + "px" ;
346
348
d . gutterFiller . style . width = d . gutters . offsetWidth + "px" ;
@@ -410,7 +412,7 @@ window.CodeMirror = (function() {
410
412
signalLater ( cm , "viewportChange" , cm , cm . display . showingFrom , cm . display . showingTo ) ;
411
413
} else break ;
412
414
updateSelection ( cm ) ;
413
- updateScrollbars ( cm . display , cm . doc . height , cm . options . fixedGutter ) ;
415
+ updateScrollbars ( cm ) ;
414
416
415
417
// Clip forced viewport to actual scrollable area
416
418
if ( viewPort )
@@ -3123,6 +3125,7 @@ window.CodeMirror = (function() {
3123
3125
cm . display . gutters . style . left = val ? compensateForHScroll ( cm . display ) + "px" : "0" ;
3124
3126
cm . refresh ( ) ;
3125
3127
} , true ) ;
3128
+ option ( "coverGutterNextToScrollbar" , false , updateScrollbars ) ;
3126
3129
option ( "lineNumbers" , false , function ( cm ) {
3127
3130
setGuttersForLineNumbers ( cm . options ) ;
3128
3131
guttersChanged ( cm ) ;
0 commit comments