suggest - dont force widget creation

This commit is contained in:
Johannes Rieken 2020-01-14 10:50:29 +01:00
parent 926407a8b5
commit 160a1c6978

View file

@ -165,7 +165,20 @@ export class SuggestController implements IEditorContribution {
}));
this._toDispose.add(toDisposable(() => makesTextEdit.reset()));
this._toDispose.add(widget.onDetailsKeyDown(e => {
// cmd + c on macOS, ctrl + c on Win / Linux
if (
e.toKeybinding().equals(new SimpleKeybinding(true, false, false, false, KeyCode.KEY_C)) ||
(platform.isMacintosh && e.toKeybinding().equals(new SimpleKeybinding(false, false, false, true, KeyCode.KEY_C)))
) {
e.stopPropagation();
return;
}
if (!e.toKeybinding().isModifierKey()) {
this.editor.focus();
}
}));
return widget;
}));
@ -198,21 +211,6 @@ export class SuggestController implements IEditorContribution {
}
}));
this._toDispose.add(this.widget.getValue().onDetailsKeyDown(e => {
// cmd + c on macOS, ctrl + c on Win / Linux
if (
e.toKeybinding().equals(new SimpleKeybinding(true, false, false, false, KeyCode.KEY_C)) ||
(platform.isMacintosh && e.toKeybinding().equals(new SimpleKeybinding(false, false, false, true, KeyCode.KEY_C)))
) {
e.stopPropagation();
return;
}
if (!e.toKeybinding().isModifierKey()) {
this.editor.focus();
}
}));
// Manage the acceptSuggestionsOnEnter context key
let acceptSuggestionsOnEnter = SuggestContext.AcceptSuggestionsOnEnter.bindTo(_contextKeyService);
let updateFromConfig = () => {