Skip to content

Commit 0c2276c

Browse files
committed
Clean up
1 parent 9385f11 commit 0c2276c

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

src/vs/workbench/contrib/terminalContrib/find/browser/terminal.find.contribution.ts

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@ class TerminalFindContribution extends Disposable implements ITerminalContributi
3838
private readonly _instance: ITerminalInstance,
3939
processManager: ITerminalProcessManager,
4040
widgetManager: TerminalWidgetManager,
41-
@IInstantiationService readonly _instantiationService: IInstantiationService,
42-
@ITerminalService readonly _terminalService: ITerminalService
41+
@IInstantiationService instantiationService: IInstantiationService,
42+
@ITerminalService terminalService: ITerminalService
4343
) {
4444
super();
4545

4646
this._findWidget = new Lazy(() => {
47-
const findWidget = this._instantiationService.createInstance(TerminalFindWidget, _instance);
47+
const findWidget = instantiationService.createInstance(TerminalFindWidget, this._instance);
4848

4949
// Track focus and set state so we can force the scroll bar to be visible
5050
findWidget.focusTracker.onDidFocus(() => {
5151
this._focusState = true;
52-
_instance.forceScrollbarVisibility();
53-
_terminalService.setActiveInstance(_instance);
52+
this._instance.forceScrollbarVisibility();
53+
terminalService.setActiveInstance(this._instance);
5454
});
5555
findWidget.focusTracker.onDidBlur(() => {
5656
this._focusState = false;
57-
_instance.resetScrollbarVisibility();
57+
this._instance.resetScrollbarVisibility();
5858
});
5959

60-
_instance.domElement.appendChild(findWidget.getDomNode());
60+
this._instance.domElement.appendChild(findWidget.getDomNode());
6161
if (this._lastLayoutDimensions) {
6262
findWidget.layout(this._lastLayoutDimensions.width);
6363
}
@@ -98,7 +98,7 @@ registerActiveInstanceAction({
9898
},
9999
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated),
100100
run: (activeInstance) => {
101-
TerminalFindContribution.get(activeInstance)?.findWidget?.reveal();
101+
TerminalFindContribution.get(activeInstance)?.findWidget.reveal();
102102
}
103103
});
104104

@@ -113,7 +113,7 @@ registerActiveInstanceAction({
113113
},
114114
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated),
115115
run: (activeInstance) => {
116-
TerminalFindContribution.get(activeInstance)?.findWidget?.hide();
116+
TerminalFindContribution.get(activeInstance)?.findWidget.hide();
117117
}
118118
});
119119

@@ -128,10 +128,8 @@ registerActiveInstanceAction({
128128
},
129129
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated),
130130
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);
135133
}
136134
});
137135

@@ -146,10 +144,8 @@ registerActiveInstanceAction({
146144
},
147145
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated),
148146
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);
153149
}
154150
});
155151

@@ -164,10 +160,8 @@ registerActiveInstanceAction({
164160
},
165161
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated),
166162
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);
171165
}
172166
});
173167

0 commit comments

Comments
 (0)