@@ -1612,6 +1612,12 @@ class SCMInputWidget extends Disposable {
1612
1612
this . editorContainer = append ( this . element , $ ( '.scm-editor-container' ) ) ;
1613
1613
this . placeholderTextContainer = append ( this . editorContainer , $ ( '.scm-editor-placeholder' ) ) ;
1614
1614
1615
+ const fontFamily = this . getInputEditorFontFamily ( ) ;
1616
+ const fontSize = this . getInputEditorFontSize ( ) ;
1617
+ const lineHeight = this . computeLineHeight ( fontSize ) ;
1618
+
1619
+ this . setPlaceholderFontStyles ( fontFamily , fontSize , lineHeight ) ;
1620
+
1615
1621
const contextKeyService2 = contextKeyService . createScoped ( this . element ) ;
1616
1622
this . repositoryContextKey = contextKeyService2 . createKey ( 'scmRepository' , undefined ) ;
1617
1623
@@ -1620,9 +1626,9 @@ class SCMInputWidget extends Disposable {
1620
1626
lineDecorationsWidth : 4 ,
1621
1627
dragAndDrop : false ,
1622
1628
cursorWidth : 1 ,
1623
- fontSize : 13 ,
1624
- lineHeight : 20 ,
1625
- fontFamily : this . getInputEditorFontFamily ( ) ,
1629
+ fontSize : fontSize ,
1630
+ lineHeight : lineHeight ,
1631
+ fontFamily : fontFamily ,
1626
1632
wrappingStrategy : 'advanced' ,
1627
1633
wrappingIndent : 'none' ,
1628
1634
padding : { top : 3 , bottom : 3 } ,
@@ -1676,11 +1682,20 @@ class SCMInputWidget extends Disposable {
1676
1682
lastLineKey . set ( viewPosition . lineNumber === lastLineNumber && viewPosition . column === lastLineCol ) ;
1677
1683
} ) ) ;
1678
1684
1679
- const onInputFontFamilyChanged = Event . filter ( this . configurationService . onDidChangeConfiguration , e => e . affectsConfiguration ( 'scm.inputFontFamily' ) ) ;
1680
- this . _register ( onInputFontFamilyChanged ( ( ) => this . inputEditor . updateOptions ( { fontFamily : this . getInputEditorFontFamily ( ) } ) ) ) ;
1685
+ const onInputFontFamilyChanged = Event . filter ( this . configurationService . onDidChangeConfiguration , e => e . affectsConfiguration ( 'scm.inputFontFamily' ) || e . affectsConfiguration ( 'scm.inputFontSize' ) ) ;
1686
+ this . _register ( onInputFontFamilyChanged ( ( ) => {
1687
+ const fontFamily = this . getInputEditorFontFamily ( ) ;
1688
+ const fontSize = this . getInputEditorFontSize ( ) ;
1689
+ const lineHeight = this . computeLineHeight ( fontSize ) ;
1681
1690
1682
- const onInputFontSizeChanged = Event . filter ( this . configurationService . onDidChangeConfiguration , e => e . affectsConfiguration ( 'scm.inputFontSize' ) ) ;
1683
- this . _register ( onInputFontSizeChanged ( ( ) => this . inputEditor . updateOptions ( { fontSize : this . getInputEditorFontSize ( ) } ) ) ) ;
1691
+ this . inputEditor . updateOptions ( {
1692
+ fontFamily : fontFamily ,
1693
+ fontSize : fontSize ,
1694
+ lineHeight : lineHeight ,
1695
+ } ) ;
1696
+
1697
+ this . setPlaceholderFontStyles ( fontFamily , fontSize , lineHeight ) ;
1698
+ } ) ) ;
1684
1699
1685
1700
this . onDidChangeContentHeight = Event . signal ( Event . filter ( this . inputEditor . onDidContentSizeChange , e => e . contentHeightChanged ) ) ;
1686
1701
}
@@ -1768,6 +1783,16 @@ class SCMInputWidget extends Disposable {
1768
1783
return this . configurationService . getValue < number > ( 'scm.inputFontSize' ) ;
1769
1784
}
1770
1785
1786
+ private computeLineHeight ( fontSize : number ) : number {
1787
+ return Math . round ( fontSize * 1.5 ) ;
1788
+ }
1789
+
1790
+ private setPlaceholderFontStyles ( fontFamily : string , fontSize : number , lineHeight : number ) : void {
1791
+ this . placeholderTextContainer . style . fontFamily = fontFamily ;
1792
+ this . placeholderTextContainer . style . fontSize = `${ fontSize } px` ;
1793
+ this . placeholderTextContainer . style . lineHeight = `${ lineHeight } px` ;
1794
+ }
1795
+
1771
1796
clearValidation ( ) : void {
1772
1797
this . validationDisposable . dispose ( ) ;
1773
1798
}
0 commit comments