提交 d32c949d 编写于 作者: J Johannes Rieken

fix #52080

上级 da4e1c37
......@@ -281,7 +281,7 @@ export class OutlineTreeState {
return { selected, focused, expanded };
}
static async restore(tree: ITree, state: OutlineTreeState): TPromise<void> {
static async restore(tree: ITree, state: OutlineTreeState, eventPayload: any): TPromise<void> {
let model = <OutlineModel>tree.getInput();
if (!state || !(model instanceof OutlineModel)) {
return TPromise.as(undefined);
......@@ -301,8 +301,8 @@ export class OutlineTreeState {
// selection & focus
let selected = model.getItemById(state.selected);
let focused = model.getItemById(state.focused);
tree.setSelection([selected]);
tree.setFocus(focused);
tree.setSelection([selected], eventPayload);
tree.setFocus(focused, eventPayload);
}
}
......
......@@ -506,7 +506,7 @@ export class OutlinePanel extends ViewletPanel {
}
await this._tree.setInput(model);
let state = this._treeStates.get(model.textModel.uri.toString());
OutlineTreeState.restore(this._tree, state);
OutlineTreeState.restore(this._tree, state, this);
}
this._input.enable();
......@@ -521,7 +521,7 @@ export class OutlinePanel extends ViewletPanel {
this._contextKeyFiltered.set(pattern.length > 0);
if (!beforePatternState) {
if (pattern && !beforePatternState) {
beforePatternState = OutlineTreeState.capture(this._tree);
}
let item = model.updateMatches(pattern);
......@@ -534,7 +534,7 @@ export class OutlinePanel extends ViewletPanel {
}
if (!pattern && beforePatternState) {
await OutlineTreeState.restore(this._tree, beforePatternState);
await OutlineTreeState.restore(this._tree, beforePatternState, this);
beforePatternState = undefined;
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册