提交 f6444b07 编写于 作者: B Benjamin Pasero

clean up

上级 c882abda
......@@ -139,9 +139,14 @@ export interface IEditorOptionsBag {
forceOpen?: boolean;
/**
* TODO@stacks clean up
* An editor that is pinned remains in the editor stack even when another editor is being opened.
* An editor that is not pinned will always get replaced by another editor that is not pinned.
*/
pinned?: boolean;
/**
* The index in the document stack where to insert the editor into when opening.
*/
index?: number;
}
......
......@@ -488,7 +488,7 @@ export class EditorPart extends Part implements IEditorPart {
}
// Closing inactive editor is just a model update
group.closeEditor(input, false);
group.closeEditor(input);
}
private doCloseActiveEditor(position: Position): TPromise<void> {
......@@ -507,7 +507,7 @@ export class EditorPart extends Part implements IEditorPart {
// Update stacks model
const group = this.groupAt(position);
group.closeEditor(group.activeEditor); // TODO@stacks allow to close any non active editor
group.closeEditor(group.activeEditor);
// Close group is this is the last editor in group
if (group.count === 0) {
......@@ -747,7 +747,7 @@ export class EditorPart extends Part implements IEditorPart {
}
// Validate active input
if (!activeInput || ![...leftEditors, ...centerEditors, ...rightEditors].some(e => e.input === activeInput)) {
if (!activeInput || ![...leftEditors, ...centerEditors, ...rightEditors].some(e => e.input.matches(activeInput))) {
activeInput = leftEditors[0].input;
}
......@@ -768,7 +768,7 @@ export class EditorPart extends Part implements IEditorPart {
const input = editor.input;
// Resolve editor options
const preserveFocus = (input !== activeInput);
const preserveFocus = !input.matches(activeInput);
let options: EditorOptions;
if (editor.options) {
options = editor.options;
......
......@@ -302,9 +302,14 @@ export class EditorOptions implements IEditorOptions {
public forceOpen: boolean;
/**
* TODO@stacks clean up
* An editor that is pinned remains in the editor stack even when another editor is being opened.
* An editor that is not pinned will always get replaced by another editor that is not pinned.
*/
public pinned: boolean;
/**
* The index in the document stack where to insert the editor into when opening.
*/
public index: number;
/**
......
......@@ -825,7 +825,7 @@ export class EditorStacksModel implements IEditorStacksModel {
if (modelRaw) {
const serialized: ISerializedEditorStacksModel = JSON.parse(modelRaw);
// TODO@stacks remove this once stacks are stable; prevent bad stored state
// TODO@Ben remove this once stacks are stable; prevent bad stored state
const invalidId = this.doValidate(serialized);
if (invalidId) {
console.warn(`Ignoring invalid stacks model (Error code: ${invalidId}): ${JSON.stringify(serialized)}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册