File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/vs/editor/browser/viewParts/lines Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -705,12 +705,10 @@ export class ViewLines extends ViewPart implements IViewLines {
705
705
let paddingBottom : number = 0 ;
706
706
707
707
if ( ! shouldIgnoreScrollOff ) {
708
- const context = Math . min ( ( viewportHeight / this . _lineHeight ) / 2 , this . _cursorSurroundingLines ) ;
709
- if ( this . _stickyScrollEnabled ) {
710
- paddingTop = Math . max ( context , this . _maxNumberStickyLines ) * this . _lineHeight ;
711
- } else {
712
- paddingTop = context * this . _lineHeight ;
713
- }
708
+ const maxLinesInViewport = ( viewportHeight / this . _lineHeight ) ;
709
+ const surroundingLines = Math . max ( this . _cursorSurroundingLines , this . _stickyScrollEnabled ? this . _maxNumberStickyLines : 0 ) ;
710
+ const context = Math . min ( maxLinesInViewport / 2 , surroundingLines ) ;
711
+ paddingTop = context * this . _lineHeight ;
714
712
paddingBottom = Math . max ( 0 , ( context - 1 ) ) * this . _lineHeight ;
715
713
} else {
716
714
if ( ! minimalReveal ) {
You can’t perform that action at this time.
0 commit comments