editors - tweak options around group activation more

This commit is contained in:
Benjamin Pasero
2019-08-26 17:49:58 +02:00
parent 61c52d0dda
commit b7996ed7c5
12 changed files with 102 additions and 43 deletions

View File

@@ -713,17 +713,33 @@ export class EditorOptions implements IEditorOptions {
}
/**
* Tells the editor to not receive keyboard focus when the editor is being opened. This
* will also prevent the group the editor opens in to become active. This can be overridden
* via the `forceActive` option.
* Tells the editor to not receive keyboard focus when the editor is being opened.
*
* By default, the editor will receive keyboard focus on open.
* Will also not activate the group the editor opens in unless the group is already the active one.
* This behaviour can be overridden via the `forceActive` option.
*/
preserveFocus: boolean | undefined;
/**
* Tells the group the editor opens in to become active even if either `preserveFocus: true`
* or `inactive: true` are specified.
* This option is only relevant if an editor is opened into a group that is not active. In
* most cases opening an editor into an inactive group will cause it to become active. With
* `preserveActive: true` in combination with `preserveFocus: true` an editor can be opened
* while keeping the current group active.
*
* Other options like `preserveFocus`, `inactive` and `forceActive` can have an impact on
* whether a group gets activated or not.
*
* Note: `forceActive: true` will always win over `preserveActive: true`.
*/
preserveActive: boolean | undefined;
/**
* This option is only relevant if an editor is opened into a group that is not active. In
* most cases opening an editor into an inactive group will cause it to become active. With
* `forceActive` the inactive group will become active independent of other options such as
* `preserveFocus` or `inactive`.
*
* Note: `forceActive: true` will always win over `preserveActive: true`.
*/
forceActive: boolean | undefined;
@@ -757,8 +773,10 @@ export class EditorOptions implements IEditorOptions {
/**
* An active editor that is opened will show its contents directly. Set to true to open an editor
* in the background. This will also prevent the group the editor opens in to become active. This
* can be overridden via the `forceActive` option.
* in the background without loading its contents.
*
* Will also not activate the group the editor opens in unless the group is already the active one.
* This behaviour can be overridden via the `forceActive` option.
*/
inactive: boolean | undefined;
@@ -788,6 +806,10 @@ export class EditorOptions implements IEditorOptions {
this.preserveFocus = options.preserveFocus;
}
if (typeof options.preserveActive === 'boolean') {
this.preserveActive = options.preserveActive;
}
if (typeof options.forceActive === 'boolean') {
this.forceActive = options.forceActive;
}