File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2139,10 +2139,6 @@ editor.on('paste', function() {
21392139} ) ;
21402140editor . on ( 'changes' , function ( cm , changes ) {
21412141 updateHistory ( ) ;
2142- preventSyncScroll = true ;
2143- var scrollInfo = editor . getScrollInfo ( ) ;
2144- editor . scrollTo ( null , scrollInfo . top - 1 ) ;
2145- editor . scrollTo ( null , scrollInfo . top ) ;
21462142 var docLength = editor . getValue ( ) . length ;
21472143 //workaround for big documents
21482144 var newViewportMargin = 20 ;
Original file line number Diff line number Diff line change @@ -115,8 +115,11 @@ var viewScrollingDelay = 200;
115115var viewScrollingTimer = null ;
116116
117117//editor.on('scroll', _.throttle(syncScrollToView, editorScrollThrottle));
118- editor . on ( 'scroll' , syncScrollToView ) ;
119- ui . area . codemirrorScroll . on ( 'scroll' , syncScrollToView ) ;
118+ if ( editor . getOption ( 'scrollbarStyle' ) === 'native' ) {
119+ ui . area . codemirrorScroll . on ( 'scroll' , syncScrollToView ) ;
120+ } else {
121+ editor . on ( 'scroll' , syncScrollToView ) ;
122+ }
120123ui . area . view . on ( 'scroll' , function ( ) {
121124 viewScrolling = true ;
122125 clearTimeout ( viewScrollingTimer ) ;
You can’t perform that action at this time.
0 commit comments