提交 ce731779 编写于 作者: D Daniel Imms

Minimize diff

上级 b41f6bfa
......@@ -36,18 +36,16 @@ export abstract class SimpleFindWidget extends Widget {
private prevBtn: SimpleButton;
private nextBtn: SimpleButton;
private foundMatch: boolean;
private readonly _invertDefaultDirection: boolean | undefined;
constructor(
@IContextViewService private readonly _contextViewService: IContextViewService,
@IContextKeyService contextKeyService: IContextKeyService,
private readonly _state: FindReplaceState = new FindReplaceState(),
showOptionButtons?: boolean,
invertDefaultDirection?: boolean
private readonly _invertDefaultDirection: boolean = false
) {
super();
this._invertDefaultDirection = invertDefaultDirection;
this._findInput = this._register(new ContextScopedFindInput(null, this._contextViewService, {
label: NLS_FIND_INPUT_LABEL,
placeholder: NLS_FIND_INPUT_PLACEHOLDER,
......@@ -96,14 +94,13 @@ export abstract class SimpleFindWidget extends Widget {
this._register(this._findInput.onKeyDown((e) => {
if (e.equals(KeyCode.Enter)) {
// Flip the direction search goes in the terminal case so it matches other terminals
this.find(this._invertDefaultDirection ? true : false);
this.find(this._invertDefaultDirection);
e.preventDefault();
return;
}
if (e.equals(KeyMod.Shift | KeyCode.Enter)) {
this.find(this._invertDefaultDirection ? false : true);
this.find(!this._invertDefaultDirection);
e.preventDefault();
return;
}
......
......@@ -8,6 +8,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_INPUT_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED } from 'vs/workbench/contrib/terminal/common/terminal';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { FindReplaceState } from 'vs/editor/contrib/find/findState';
export class TerminalFindWidget extends SimpleFindWidget {
protected _findInputFocused: IContextKey<boolean>;
protected _findWidgetFocused: IContextKey<boolean>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册