@@ -210,12 +210,12 @@ class StickyScrollController extends Disposable implements IEditorContribution {
210
210
if ( ! beginningLinesConsidered . has ( start ) ) {
211
211
if ( topOfElementAtDepth >= topOfEndLine - 1 && topOfElementAtDepth < bottomOfEndLine - 2 ) {
212
212
beginningLinesConsidered . add ( start ) ;
213
- this . stickyScrollWidget . pushCodeLine ( new StickyScrollCodeLine ( start , this . _editor , - 1 , bottomOfEndLine - bottomOfElementAtDepth ) ) ;
213
+ this . stickyScrollWidget . pushCodeLine ( new StickyScrollCodeLine ( start , depth , this . _editor , - 1 , bottomOfEndLine - bottomOfElementAtDepth ) ) ;
214
214
break ;
215
215
}
216
- else if ( bottomOfElementAtDepth > bottomOfBeginningLine - 1 && bottomOfElementAtDepth < bottomOfEndLine - 1 ) {
216
+ else if ( bottomOfElementAtDepth > bottomOfBeginningLine && bottomOfElementAtDepth < bottomOfEndLine - 1 ) {
217
217
beginningLinesConsidered . add ( start ) ;
218
- this . stickyScrollWidget . pushCodeLine ( new StickyScrollCodeLine ( start , this . _editor , 0 , 0 ) ) ;
218
+ this . stickyScrollWidget . pushCodeLine ( new StickyScrollCodeLine ( start , depth , this . _editor , 0 , 0 ) ) ;
219
219
}
220
220
} else {
221
221
this . _ranges . splice ( index , 1 ) ;
@@ -237,7 +237,7 @@ class StickyScrollCodeLine {
237
237
238
238
public readonly effectiveLineHeight : number = 0 ;
239
239
240
- constructor ( private readonly _lineNumber : number , private readonly _editor : IActiveCodeEditor ,
240
+ constructor ( private readonly _lineNumber : number , private readonly _depth : number , private readonly _editor : IActiveCodeEditor ,
241
241
private readonly _zIndex : number , private readonly _relativePosition : number ) {
242
242
this . effectiveLineHeight = this . _editor . getOption ( EditorOption . lineHeight ) + this . _relativePosition ;
243
243
}
@@ -302,8 +302,9 @@ class StickyScrollCodeLine {
302
302
root . onclick = e => {
303
303
e . stopPropagation ( ) ;
304
304
e . preventDefault ( ) ;
305
- this . _editor . revealLine ( this . _lineNumber ) ;
305
+ this . _editor . revealPosition ( { lineNumber : this . _lineNumber - this . _depth + 1 , column : 1 } ) ;
306
306
} ;
307
+
307
308
root . onmouseover = e => {
308
309
innerLineNumberHTML . style . background = `var(--vscode-editorStickyScrollHover-background)` ;
309
310
lineHTMLNode . style . backgroundColor = `var(--vscode-editorStickyScrollHover-background)` ;
@@ -353,7 +354,7 @@ class StickyScrollWidget implements IOverlayWidget {
353
354
constructor ( public readonly _editor : ICodeEditor ) {
354
355
this . rootDomNode = document . createElement ( 'div' ) ;
355
356
this . rootDomNode . style . width = '100%' ;
356
- this . rootDomNode . style . boxShadow = `var(--vscode-scrollbar-shadow) 0 6px 6px -6px` ; // '0px 0px 8px 2px #000000';
357
+ this . rootDomNode . style . boxShadow = `var(--vscode-scrollbar-shadow) 0 6px 6px -6px` ;
357
358
}
358
359
359
360
get codeLineCount ( ) {
0 commit comments