@@ -38,26 +38,26 @@ class TerminalFindContribution extends Disposable implements ITerminalContributi
38
38
private readonly _instance : ITerminalInstance ,
39
39
processManager : ITerminalProcessManager ,
40
40
widgetManager : TerminalWidgetManager ,
41
- @IInstantiationService readonly _instantiationService : IInstantiationService ,
42
- @ITerminalService readonly _terminalService : ITerminalService
41
+ @IInstantiationService instantiationService : IInstantiationService ,
42
+ @ITerminalService terminalService : ITerminalService
43
43
) {
44
44
super ( ) ;
45
45
46
46
this . _findWidget = new Lazy ( ( ) => {
47
- const findWidget = this . _instantiationService . createInstance ( TerminalFindWidget , _instance ) ;
47
+ const findWidget = instantiationService . createInstance ( TerminalFindWidget , this . _instance ) ;
48
48
49
49
// Track focus and set state so we can force the scroll bar to be visible
50
50
findWidget . focusTracker . onDidFocus ( ( ) => {
51
51
this . _focusState = true ;
52
- _instance . forceScrollbarVisibility ( ) ;
53
- _terminalService . setActiveInstance ( _instance ) ;
52
+ this . _instance . forceScrollbarVisibility ( ) ;
53
+ terminalService . setActiveInstance ( this . _instance ) ;
54
54
} ) ;
55
55
findWidget . focusTracker . onDidBlur ( ( ) => {
56
56
this . _focusState = false ;
57
- _instance . resetScrollbarVisibility ( ) ;
57
+ this . _instance . resetScrollbarVisibility ( ) ;
58
58
} ) ;
59
59
60
- _instance . domElement . appendChild ( findWidget . getDomNode ( ) ) ;
60
+ this . _instance . domElement . appendChild ( findWidget . getDomNode ( ) ) ;
61
61
if ( this . _lastLayoutDimensions ) {
62
62
findWidget . layout ( this . _lastLayoutDimensions . width ) ;
63
63
}
@@ -98,7 +98,7 @@ registerActiveInstanceAction({
98
98
} ,
99
99
precondition : ContextKeyExpr . or ( TerminalContextKeys . processSupported , TerminalContextKeys . terminalHasBeenCreated ) ,
100
100
run : ( activeInstance ) => {
101
- TerminalFindContribution . get ( activeInstance ) ?. findWidget ? .reveal ( ) ;
101
+ TerminalFindContribution . get ( activeInstance ) ?. findWidget . reveal ( ) ;
102
102
}
103
103
} ) ;
104
104
@@ -113,7 +113,7 @@ registerActiveInstanceAction({
113
113
} ,
114
114
precondition : ContextKeyExpr . or ( TerminalContextKeys . processSupported , TerminalContextKeys . terminalHasBeenCreated ) ,
115
115
run : ( activeInstance ) => {
116
- TerminalFindContribution . get ( activeInstance ) ?. findWidget ? .hide ( ) ;
116
+ TerminalFindContribution . get ( activeInstance ) ?. findWidget . hide ( ) ;
117
117
}
118
118
} ) ;
119
119
@@ -128,10 +128,8 @@ registerActiveInstanceAction({
128
128
} ,
129
129
precondition : ContextKeyExpr . or ( TerminalContextKeys . processSupported , TerminalContextKeys . terminalHasBeenCreated ) ,
130
130
run : ( activeInstance ) => {
131
- const state = TerminalFindContribution . get ( activeInstance ) ?. findWidget ?. state ;
132
- if ( state ) {
133
- state . change ( { matchCase : ! state . isRegex } , false ) ;
134
- }
131
+ const state = TerminalFindContribution . get ( activeInstance ) ?. findWidget . state ;
132
+ state ?. change ( { matchCase : ! state . isRegex } , false ) ;
135
133
}
136
134
} ) ;
137
135
@@ -146,10 +144,8 @@ registerActiveInstanceAction({
146
144
} ,
147
145
precondition : ContextKeyExpr . or ( TerminalContextKeys . processSupported , TerminalContextKeys . terminalHasBeenCreated ) ,
148
146
run : ( activeInstance ) => {
149
- const state = TerminalFindContribution . get ( activeInstance ) ?. findWidget ?. state ;
150
- if ( state ) {
151
- state . change ( { matchCase : ! state . wholeWord } , false ) ;
152
- }
147
+ const state = TerminalFindContribution . get ( activeInstance ) ?. findWidget . state ;
148
+ state ?. change ( { matchCase : ! state . wholeWord } , false ) ;
153
149
}
154
150
} ) ;
155
151
@@ -164,10 +160,8 @@ registerActiveInstanceAction({
164
160
} ,
165
161
precondition : ContextKeyExpr . or ( TerminalContextKeys . processSupported , TerminalContextKeys . terminalHasBeenCreated ) ,
166
162
run : ( activeInstance ) => {
167
- const state = TerminalFindContribution . get ( activeInstance ) ?. findWidget ?. state ;
168
- if ( state ) {
169
- state . change ( { matchCase : ! state . matchCase } , false ) ;
170
- }
163
+ const state = TerminalFindContribution . get ( activeInstance ) ?. findWidget . state ;
164
+ state ?. change ( { matchCase : ! state . matchCase } , false ) ;
171
165
}
172
166
} ) ;
173
167
0 commit comments