Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)

This commit is contained in:
Anthony Dresser
2019-09-24 21:36:17 -07:00
committed by GitHub
parent a29ae4d3b9
commit 6a6048d40f
541 changed files with 7045 additions and 7287 deletions

View File

@@ -737,7 +737,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
);
}
public setSelections(ranges: ISelection[], source: string = 'api'): void {
public setSelections(ranges: readonly ISelection[], source: string = 'api'): void {
if (!this._modelData) {
return;
}
@@ -1172,7 +1172,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
}
public hasWidgetFocus(): boolean {
return (this._editorWidgetFocus.getValue() === BooleanEventValue.True);
return this._focusTracker && this._focusTracker.hasFocus();
}
public addContentWidget(widget: editorBrowser.IContentWidget): void {
@@ -1452,13 +1452,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
}
const viewOutgoingEvents = new ViewOutgoingEvents(viewModel);
viewOutgoingEvents.onDidGainFocus = () => {
this._editorTextFocus.setValue(true);
// In IE, the focus is not synchronous, so we give it a little help
this._editorWidgetFocus.setValue(true);
};
viewOutgoingEvents.onDidScroll = (e) => this._onDidScrollChange.fire(e);
viewOutgoingEvents.onDidGainFocus = () => this._editorTextFocus.setValue(true);
viewOutgoingEvents.onDidLoseFocus = () => this._editorTextFocus.setValue(false);
viewOutgoingEvents.onContextMenu = (e) => this._onContextMenu.fire(e);
viewOutgoingEvents.onMouseDown = (e) => this._onMouseDown.fire(e);
@@ -1548,10 +1543,6 @@ export class BooleanEventEmitter extends Disposable {
this._value = BooleanEventValue.NotSet;
}
public getValue(): BooleanEventValue {
return this._value;
}
public setValue(_value: boolean) {
const value = (_value ? BooleanEventValue.True : BooleanEventValue.False);
if (this._value === value) {