提交 960c1645 编写于 作者: N Ntovas

Keep item expanded after rename

上级 90316996
......@@ -518,10 +518,14 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
restoreFocus = true;
}
let isExpanded = false;
// Handle Rename
if (oldParentResource && newParentResource && oldParentResource.toString() === newParentResource.toString()) {
const modelElements = this.model.findAll(oldResource);
modelElements.forEach(modelElement => {
//Check if element is expanded
isExpanded = this.explorerViewer.isExpanded(modelElement);
// Rename File (Model)
modelElement.rename(newElement);
......@@ -532,6 +536,10 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
if (restoreFocus) {
this.explorerViewer.setFocus(modelElement);
}
//Expand the element again
if(isExpanded){
this.explorerViewer.expand(modelElement);
}
}, errors.onUnexpectedError);
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册