File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ function buildMapInner(syncBack) {
221221 if ( t !== 0 ) {
222222 nonEmptyList . push ( t ) ;
223223 }
224- _scrollMap [ t ] = Math . round ( $el . offset ( ) . top + offset ) ;
224+ _scrollMap [ t ] = Math . round ( $el . offset ( ) . top + offset - 10 ) ;
225225 }
226226
227227 nonEmptyList . push ( linesCount ) ;
@@ -297,7 +297,7 @@ function syncScrollToView(event, _lineNo) {
297297 var textHeight = editor . defaultTextHeight ( ) ;
298298 lineNo = Math . floor ( scrollInfo . top / textHeight ) ;
299299 //if reach bottom, then scroll to end
300- if ( scrollInfo . height > scrollInfo . clientHeight && scrollInfo . top + scrollInfo . clientHeight >= scrollInfo . height - defaultTextHeight ) {
300+ if ( scrollInfo . height > scrollInfo . clientHeight && scrollInfo . top + scrollInfo . clientHeight >= scrollInfo . height - textHeight ) {
301301 posTo = ui . area . view [ 0 ] . scrollHeight - ui . area . view . height ( ) ;
302302 } else {
303303 topDiffPercent = ( scrollInfo . top % textHeight ) / textHeight ;
You can’t perform that action at this time.
0 commit comments