@@ -26,7 +26,7 @@ import { RawContextKey, IContextKey, IContextKeyService } from '../../../../plat
2626import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
2727import { isObject } from '../../../../base/common/types.js' ;
2828import { CommandsRegistry } from '../../../../platform/commands/common/commands.js' ;
29- import { IEditorOptions as ICodeEditorOptions , EditorOption } from '../../../../editor/common/config/editorOptions.js' ;
29+ import { EditorOption , IEditorOptions as ICodeEditorOptions } from '../../../../editor/common/config/editorOptions.js' ;
3030import { IThemeService } from '../../../../platform/theme/common/themeService.js' ;
3131import { UILabelProvider } from '../../../../base/common/keybindingLabels.js' ;
3232import { OS , OperatingSystem } from '../../../../base/common/platform.js' ;
@@ -326,7 +326,8 @@ export class WalkThroughPart extends EditorPane {
326326 this . contentDisposables . push ( editor ) ;
327327
328328 const updateHeight = ( initial : boolean ) => {
329- const lineHeight = editor . getOption ( EditorOption . lineHeight ) ;
329+ const position = editor . getPosition ( ) ;
330+ const lineHeight = position ? editor . getLineHeightForPosition ( position ) : editor . getOption ( EditorOption . lineHeight ) ;
330331 const height = `${ Math . max ( model . getLineCount ( ) + 1 , 4 ) * lineHeight } px` ;
331332 if ( div . style . height !== height ) {
332333 div . style . height = height ;
@@ -343,7 +344,7 @@ export class WalkThroughPart extends EditorPane {
343344 if ( innerContent ) {
344345 const targetTop = div . getBoundingClientRect ( ) . top ;
345346 const containerTop = innerContent . getBoundingClientRect ( ) . top ;
346- const lineHeight = editor . getOption ( EditorOption . lineHeight ) ;
347+ const lineHeight = editor . getLineHeightForPosition ( e . position ) ;
347348 const lineTop = ( targetTop + ( e . position . lineNumber - 1 ) * lineHeight ) - containerTop ;
348349 const lineBottom = lineTop + lineHeight ;
349350 const scrollDimensions = this . scrollbar . getScrollDimensions ( ) ;
@@ -495,3 +496,4 @@ export class WalkThroughPart extends EditorPane {
495496 super . dispose ( ) ;
496497 }
497498}
499+
0 commit comments