@@ -468,7 +468,7 @@ export class InlayHintsController implements IEditorContribution {
468
468
469
469
470
470
//
471
- const { fontSize, fontFamily, padding } = this . _getLayoutInfo ( ) ;
471
+ const { fontSize, fontFamily, padding, isUniform } = this . _getLayoutInfo ( ) ;
472
472
const fontFamilyVar = '--code-editorInlayHintsFontFamily' ;
473
473
this . _editor . getContainerDomNode ( ) . style . setProperty ( fontFamilyVar , fontFamily ) ;
474
474
@@ -493,7 +493,7 @@ export class InlayHintsController implements IEditorContribution {
493
493
const cssProperties : CssProperties = {
494
494
fontSize : `${ fontSize } px` ,
495
495
fontFamily : `var(${ fontFamilyVar } ), ${ EDITOR_FONT_DEFAULTS . fontFamily } ` ,
496
- verticalAlign : 'middle' ,
496
+ verticalAlign : isUniform ? 'baseline' : 'middle' ,
497
497
} ;
498
498
499
499
if ( isNonEmptyArray ( item . hint . textEdits ) ) {
@@ -587,13 +587,23 @@ export class InlayHintsController implements IEditorContribution {
587
587
588
588
private _getLayoutInfo ( ) {
589
589
const options = this . _editor . getOption ( EditorOption . inlayHints ) ;
590
+ const padding = options . padding ;
591
+
590
592
const editorFontSize = this . _editor . getOption ( EditorOption . fontSize ) ;
593
+ const editorFontFamily = this . _editor . getOption ( EditorOption . fontFamily ) ;
594
+
591
595
let fontSize = options . fontSize ;
592
596
if ( ! fontSize || fontSize < 5 || fontSize > editorFontSize ) {
593
597
fontSize = editorFontSize ;
594
598
}
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 } ;
597
607
}
598
608
599
609
private _removeAllDecorations ( ) : void {
0 commit comments