@@ -468,7 +468,7 @@ export class InlayHintsController implements IEditorContribution {
468468
469469
470470 //
471- const { fontSize, fontFamily, padding } = this . _getLayoutInfo ( ) ;
471+ const { fontSize, fontFamily, padding, isUniform } = this . _getLayoutInfo ( ) ;
472472 const fontFamilyVar = '--code-editorInlayHintsFontFamily' ;
473473 this . _editor . getContainerDomNode ( ) . style . setProperty ( fontFamilyVar , fontFamily ) ;
474474
@@ -493,7 +493,7 @@ export class InlayHintsController implements IEditorContribution {
493493 const cssProperties : CssProperties = {
494494 fontSize : `${ fontSize } px` ,
495495 fontFamily : `var(${ fontFamilyVar } ), ${ EDITOR_FONT_DEFAULTS . fontFamily } ` ,
496- verticalAlign : 'middle' ,
496+ verticalAlign : isUniform ? 'baseline' : 'middle' ,
497497 } ;
498498
499499 if ( isNonEmptyArray ( item . hint . textEdits ) ) {
@@ -587,13 +587,23 @@ export class InlayHintsController implements IEditorContribution {
587587
588588 private _getLayoutInfo ( ) {
589589 const options = this . _editor . getOption ( EditorOption . inlayHints ) ;
590+ const padding = options . padding ;
591+
590592 const editorFontSize = this . _editor . getOption ( EditorOption . fontSize ) ;
593+ const editorFontFamily = this . _editor . getOption ( EditorOption . fontFamily ) ;
594+
591595 let fontSize = options . fontSize ;
592596 if ( ! fontSize || fontSize < 5 || fontSize > editorFontSize ) {
593597 fontSize = editorFontSize ;
594598 }
595- const fontFamily = options . fontFamily || this . _editor . getOption ( EditorOption . fontFamily ) ;
596- return { fontSize, fontFamily, padding : options . padding } ;
599+
600+ const fontFamily = options . fontFamily || editorFontFamily ;
601+
602+ const isUniform = ! padding
603+ && fontFamily === editorFontFamily
604+ && fontSize === editorFontSize ;
605+
606+ return { fontSize, fontFamily, padding, isUniform } ;
597607 }
598608
599609 private _removeAllDecorations ( ) : void {
0 commit comments