提交 03c39a24 编写于 作者: B Benjamin Pasero

drop forceActive in favour of IEditorService.setActive()

上级 df5f8335
......@@ -70,10 +70,10 @@ export interface IResourceInput {
preserveFocus?: boolean;
/**
* Ensures that the editor is being activated even if the input is already showing. This only applies
* if there is more than one editor open already and preserveFocus is set to false.
* TODO@stacks clean up
*/
forceActive?: boolean;
pinned?: boolean;
index?: number;
};
}
......
......@@ -422,11 +422,6 @@ export class EditorPart extends Part implements IEditorPart {
editor.focus();
}
// Otherwise check if we want to activate
else if (options && options.forceActive) {
this.sideBySideControl.setActive(editor);
}
// Progress Done
this.sideBySideControl.updateProgress(position, ProgressState.DONE);
......
......@@ -266,15 +266,12 @@ export class EditorOptions implements IEditorOptions {
public static create(settings: {
preserveFocus?: boolean;
forceOpen?: boolean;
forceActive?: boolean,
pinned?: boolean,
active?: boolean,
index?: number
}): EditorOptions {
let options = new EditorOptions();
options.preserveFocus = settings.preserveFocus;
options.forceOpen = settings.forceOpen;
options.forceActive = settings.forceActive;
options.pinned = settings.pinned;
options.index = settings.index;
......@@ -287,7 +284,6 @@ export class EditorOptions implements IEditorOptions {
public mixin(other: EditorOptions): void {
this.preserveFocus = other.preserveFocus;
this.forceOpen = other.forceOpen;
this.forceActive = other.forceActive;
this.pinned = other.pinned;
this.index = other.index;
}
......@@ -305,14 +301,6 @@ export class EditorOptions implements IEditorOptions {
*/
public forceOpen: boolean;
/**
* Ensures that the editor is being activated even if the input is already showing. This only applies
* if there is more than one editor open already and preserveFocus is set to false.
*
* TODO@stacks does this still apply?
*/
public forceActive: boolean;
/**
* TODO@stacks clean up
*/
......@@ -356,6 +344,14 @@ export class TextEditorOptions extends EditorOptions {
if (input.options.preserveFocus) {
options.preserveFocus = true;
}
if (input.options.pinned) {
options.pinned = true;
}
if (typeof input.options.index === 'number') {
options.index = input.options.index;
}
}
return options;
......@@ -364,11 +360,18 @@ export class TextEditorOptions extends EditorOptions {
/**
* Helper to create TextEditorOptions inline.
*/
public static create(settings: { preserveFocus?: boolean; forceOpen?: boolean; forceActive?: boolean; selection?: IRange }): TextEditorOptions {
public static create(settings: {
preserveFocus?: boolean;
forceOpen?: boolean;
pinned?: boolean;
index?: number;
selection?: IRange
}): TextEditorOptions {
let options = new TextEditorOptions();
options.preserveFocus = settings.preserveFocus;
options.forceActive = settings.forceActive;
options.forceOpen = settings.forceOpen;
options.pinned = settings.pinned;
options.index = settings.index;
if (settings.selection) {
options.startLineNumber = settings.selection.startLineNumber;
......
......@@ -735,7 +735,7 @@ export class DebugService implements debug.IDebugService {
if (control) {
control.revealLineInCenterIfOutsideViewport(lineNumber);
control.setSelection({ startLineNumber: lineNumber, startColumn: 1, endLineNumber: lineNumber, endColumn: 1 });
return this.editorService.openEditor(visibleEditors[i].input, wbeditorcommon.TextEditorOptions.create({ preserveFocus: preserveFocus, forceActive: true }), visibleEditors[i].position);
this.editorService.activateEditor(visibleEditors[i]);
}
return TPromise.as(null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册