@@ -15,7 +15,17 @@ import { IShellLaunchConfig, ITerminalTabLayoutInfoById } from 'vs/platform/term
15
15
import { TerminalStatus } from 'vs/workbench/contrib/terminal/browser/terminalStatusList' ;
16
16
import { getPartByLocation } from 'vs/workbench/browser/parts/views/viewsService' ;
17
17
18
- const SPLIT_PANE_MIN_SIZE = 120 ;
18
+ const enum Constants {
19
+ /**
20
+ * The minimum size in pixels of a split pane.
21
+ */
22
+ SplitPaneMinSize = 120 ,
23
+ /**
24
+ * The number of cells the terminal gets added or removed when asked to increase or decrease
25
+ * the view size.
26
+ */
27
+ ResizePartCellCount = 4
28
+ }
19
29
20
30
class SplitPaneContainer extends Disposable {
21
31
private _height : number ;
@@ -91,10 +101,10 @@ class SplitPaneContainer extends Disposable {
91
101
}
92
102
93
103
// Ensure the size is not reduced beyond the minimum, otherwise weird things can happen
94
- if ( sizes [ index ] + amount < SPLIT_PANE_MIN_SIZE ) {
95
- amount = SPLIT_PANE_MIN_SIZE - sizes [ index ] ;
96
- } else if ( sizes [ indexToChange ] - amount < SPLIT_PANE_MIN_SIZE ) {
97
- amount = sizes [ indexToChange ] - SPLIT_PANE_MIN_SIZE ;
104
+ if ( sizes [ index ] + amount < Constants . SplitPaneMinSize ) {
105
+ amount = Constants . SplitPaneMinSize - sizes [ index ] ;
106
+ } else if ( sizes [ indexToChange ] - amount < Constants . SplitPaneMinSize ) {
107
+ amount = sizes [ indexToChange ] - Constants . SplitPaneMinSize ;
98
108
}
99
109
100
110
// Apply the size change
@@ -207,7 +217,7 @@ class SplitPaneContainer extends Disposable {
207
217
}
208
218
209
219
class SplitPane implements IView {
210
- minimumSize : number = SPLIT_PANE_MIN_SIZE ;
220
+ minimumSize : number = Constants . SplitPaneMinSize ;
211
221
maximumSize : number = Number . MAX_VALUE ;
212
222
213
223
orientation : Orientation | undefined ;
@@ -560,9 +570,9 @@ export class TerminalGroup extends Disposable implements ITerminalGroup {
560
570
const isHorizontal = ( direction === Direction . Left || direction === Direction . Right ) ;
561
571
const font = this . _terminalService . configHelper . getFont ( ) ;
562
572
// TODO: Support letter spacing and line height
563
- const amount = isHorizontal ? font . charWidth : font . charHeight ;
564
- if ( amount ) {
565
- this . _splitPaneContainer . resizePane ( this . _activeInstanceIndex , direction , amount , getPartByLocation ( this . _terminalLocation ) ) ;
573
+ const charSize = ( isHorizontal ? font . charWidth : font . charHeight ) ;
574
+ if ( charSize ) {
575
+ this . _splitPaneContainer . resizePane ( this . _activeInstanceIndex , direction , charSize * Constants . ResizePartCellCount , getPartByLocation ( this . _terminalLocation ) ) ;
566
576
}
567
577
}
568
578
0 commit comments