@@ -2263,11 +2263,19 @@ class SCMInputWidget {
2263
2263
}
2264
2264
2265
2265
getContentHeight ( ) : number {
2266
- const inputEditorMinHeight = this . getInputEditorMinHeight ( ) ;
2267
- const editorContentHeight = Math . max ( this . inputEditor . getContentHeight ( ) , inputEditorMinHeight ) ;
2268
- const editorContextHeightMax = this . getInputEditorMaxHeight ( ) ;
2266
+ const fontSize = this . getInputEditorFontSize ( ) ;
2267
+ const lineHeight = this . computeLineHeight ( fontSize ) ;
2268
+ const { top , bottom } = this . inputEditor . getOption ( EditorOption . padding ) ;
2269
2269
2270
- return Math . min ( editorContentHeight , editorContextHeightMax ) ;
2270
+ const inputMinLinesConfig = this . configurationService . getValue ( 'scm.inputMinLines' ) ;
2271
+ const inputMinLines = typeof inputMinLinesConfig === 'number' ? clamp ( inputMinLinesConfig , 1 , 50 ) : 1 ;
2272
+ const editorMinHeight = inputMinLines * lineHeight + top + bottom ;
2273
+
2274
+ const inputMaxLinesConfig = this . configurationService . getValue ( 'scm.inputMaxLines' ) ;
2275
+ const inputMaxLines = typeof inputMaxLinesConfig === 'number' ? clamp ( inputMaxLinesConfig , 1 , 50 ) : 10 ;
2276
+ const editorMaxHeight = inputMaxLines * lineHeight + top + bottom ;
2277
+
2278
+ return clamp ( this . inputEditor . getContentHeight ( ) , editorMinHeight , editorMaxHeight ) ;
2271
2279
}
2272
2280
2273
2281
layout ( ) : void {
@@ -2404,34 +2412,6 @@ class SCMInputWidget {
2404
2412
return this . configurationService . getValue < number > ( 'scm.inputFontSize' ) ;
2405
2413
}
2406
2414
2407
- private getInputEditorMaxLines ( ) : number {
2408
- const inputMaxLines = this . configurationService . getValue ( 'scm.inputMaxLines' ) ;
2409
- return typeof inputMaxLines === 'number' ? clamp ( inputMaxLines , 1 , 50 ) : 10 ;
2410
- }
2411
-
2412
- private getInputEditorMinLines ( ) : number {
2413
- const inputMinLines = this . configurationService . getValue ( 'scm.inputMinLines' ) ;
2414
- return typeof inputMinLines === 'number' ? clamp ( inputMinLines , 1 , 50 ) : 1 ;
2415
- }
2416
-
2417
- private getInputEditorMaxHeight ( ) : number {
2418
- const maxLines = this . getInputEditorMaxLines ( ) ;
2419
- const fontSize = this . getInputEditorFontSize ( ) ;
2420
- const lineHeight = this . computeLineHeight ( fontSize ) ;
2421
- const { top, bottom } = this . inputEditor . getOption ( EditorOption . padding ) ;
2422
-
2423
- return maxLines * lineHeight + top + bottom ;
2424
- }
2425
-
2426
- private getInputEditorMinHeight ( ) : number {
2427
- const minLines = this . getInputEditorMinLines ( ) ;
2428
- const fontSize = this . getInputEditorFontSize ( ) ;
2429
- const lineHeight = this . computeLineHeight ( fontSize ) ;
2430
- const { top, bottom } = this . inputEditor . getOption ( EditorOption . padding ) ;
2431
-
2432
- return minLines * lineHeight + top + bottom ;
2433
- }
2434
-
2435
2415
private getToolbarWidth ( ) : number {
2436
2416
const showInputActionButton = this . configurationService . getValue < boolean > ( 'scm.showInputActionButton' ) ;
2437
2417
if ( ! this . toolbar || ! showInputActionButton || this . toolbar ?. isEmpty ( ) === true ) {
@@ -2667,7 +2647,9 @@ export class SCMViewPane extends ViewPane {
2667
2647
e . affectsConfiguration ( 'scm.showActionButton' ) ||
2668
2648
e . affectsConfiguration ( 'scm.alwaysShowRepositories' ) ||
2669
2649
e . affectsConfiguration ( 'scm.showIncomingChanges' ) ||
2670
- e . affectsConfiguration ( 'scm.showOutgoingChanges' ) ) {
2650
+ e . affectsConfiguration ( 'scm.showOutgoingChanges' ) ||
2651
+ e . affectsConfiguration ( 'scm.inputMinLines' ) ||
2652
+ e . affectsConfiguration ( 'scm.inputMaxLines' ) ) {
2671
2653
this . _showActionButton = this . configurationService . getValue < boolean > ( 'scm.showActionButton' ) ;
2672
2654
this . _alwaysShowRepositories = this . configurationService . getValue < boolean > ( 'scm.alwaysShowRepositories' ) ;
2673
2655
this . _showIncomingChanges = this . configurationService . getValue < ShowChangesSetting > ( 'scm.showIncomingChanges' ) ;
0 commit comments