@@ -2088,9 +2088,6 @@ class SCMInputWidget {
2088
2088
this . actionBar . push ( action , { icon : true , label : false } ) ;
2089
2089
}
2090
2090
2091
- const showInputActionButton = this . configurationService . getValue < boolean > ( 'scm.showInputActionButton' ) === true ;
2092
- this . actionBar . domNode . classList . toggle ( 'hidden' , ! showInputActionButton || this . actionBar . isEmpty ( ) ) ;
2093
-
2094
2091
this . layout ( ) ;
2095
2092
} ;
2096
2093
@@ -2330,7 +2327,7 @@ class SCMInputWidget {
2330
2327
2331
2328
layout ( ) : void {
2332
2329
const editorHeight = this . getContentHeight ( ) ;
2333
- const toolbarWidth = this . toolbarContainer . clientWidth ;
2330
+ const toolbarWidth = this . getToolbarWidth ( ) ;
2334
2331
const dimension = new Dimension ( this . element . clientWidth - toolbarWidth , editorHeight ) ;
2335
2332
2336
2333
if ( dimension . width < 0 ) {
@@ -2343,6 +2340,9 @@ class SCMInputWidget {
2343
2340
this . placeholderTextContainer . style . width = `${ dimension . width } px` ;
2344
2341
this . renderValidation ( ) ;
2345
2342
2343
+ this . actionBar . domNode . classList . toggle ( 'hidden' , this . actionBar . isEmpty ( ) ) ;
2344
+ this . toolbarContainer . classList . toggle ( 'hidden' , this . configurationService . getValue < boolean > ( 'scm.showInputActionButton' ) === false ) ;
2345
+
2346
2346
if ( this . shouldFocusAfterLayout ) {
2347
2347
this . shouldFocusAfterLayout = false ;
2348
2348
this . focus ( ) ;
@@ -2473,6 +2473,17 @@ class SCMInputWidget {
2473
2473
return maxLines * lineHeight + top + bottom ;
2474
2474
}
2475
2475
2476
+ private getToolbarWidth ( ) : number {
2477
+ const showInputActionButton = this . configurationService . getValue < boolean > ( 'scm.showInputActionButton' ) ;
2478
+ const actionCount = this . toolbarContextKeyService . getContextKeyValue < number > ( SCMInputContextKeys . ActionCount . key ) ?? 0 ;
2479
+
2480
+ if ( ! showInputActionButton || ( this . actionBar . isEmpty ( ) && actionCount === 0 ) ) {
2481
+ return 0 ;
2482
+ }
2483
+
2484
+ return 26 ; /* 22px action + 4px margin */
2485
+ }
2486
+
2476
2487
private computeLineHeight ( fontSize : number ) : number {
2477
2488
return Math . round ( fontSize * 1.5 ) ;
2478
2489
}
0 commit comments