提交 27f7c0bc 编写于 作者: I isidor

fix cmd + w not working when wrong list selected

上级 0665fd2b
......@@ -318,34 +318,36 @@ function registerEditorCommands() {
const editorsToClose = new Map<Position, IEditorInput[]>();
if (groups.length === 0) {
const activeEditor = editorService.getActiveEditor();
if (activeEditor) {
return editorService.closeEditor(activeEditor.position, activeEditor.input);
}
}
groups.forEach(group => {
const position = editorGroupService.getStacksModel().positionOfGroup(group);
editorsToClose.set(position, contexts.map(c => {
if (group === c.group) {
let input = c ? c.editor : undefined;
if (!input) {
// Get Top Editor at Position
const visibleEditors = editorService.getVisibleEditors();
if (visibleEditors[position]) {
input = visibleEditors[position].input;
if (position >= 0) {
editorsToClose.set(position, contexts.map(c => {
if (group === c.group) {
let input = c ? c.editor : undefined;
if (!input) {
// Get Top Editor at Position
const visibleEditors = editorService.getVisibleEditors();
if (visibleEditors[position]) {
input = visibleEditors[position].input;
}
}
}
return input;
}
return input;
}
return undefined;
}).filter(input => !!input));
return undefined;
}).filter(input => !!input));
}
});
if (editorsToClose.size === 0) {
const activeEditor = editorService.getActiveEditor();
if (activeEditor) {
return editorService.closeEditor(activeEditor.position, activeEditor.input);
}
}
return editorService.closeEditors({
positionOne: editorsToClose.get(Position.ONE),
positionTwo: editorsToClose.get(Position.TWO),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册