diff options
author | Nate Rauh <NRauh@users.noreply.github.com> | 2019-10-15 09:03:07 +0300 |
---|---|---|
committer | Benjamin Pasero <benjpas@microsoft.com> | 2019-10-15 09:03:07 +0300 |
commit | 11daba9b002d84f736431cf35c3b50b4e431d8b9 (patch) | |
tree | c723071456b0876df02de7e05c8df2f619b62cf4 | |
parent | 911eabf34a97b7aa5ab1242287abd0135c2de891 (diff) |
Feature/pin close others (#82545)
* Pin the active editor when closing other editors
* Pin active editor when closing editors to right
-rw-r--r-- | src/vs/workbench/browser/parts/editor/editorCommands.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index 654a9c96650..202fdb5b5d5 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -606,6 +606,10 @@ function registerCloseEditorCommands() { .map(context => typeof context.editorIndex === 'number' ? group.getEditor(context.editorIndex) : group.activeEditor); const editorsToClose = group.editors.filter(e => editors.indexOf(e) === -1); + if (group.activeEditor) { + group.pinEditor(group.activeEditor); + } + return group.closeEditors(editorsToClose); } @@ -624,6 +628,10 @@ function registerCloseEditorCommands() { const { group, editor } = resolveCommandsContext(editorGroupService, getCommandsContext(resourceOrContext, context)); if (group && editor) { + if (group.activeEditor) { + group.pinEditor(group.activeEditor); + } + return group.closeEditors({ direction: CloseDirection.RIGHT, except: editor }); } |