Add setting to prevent closing the pinned tab when using middle click (fix #115734) (#188592)

* Fix: Add setting to prevent closing the pinned tab when using middle click (#115734)

* Revert "Fix: Add setting to prevent closing the pinned tab when using middle click (#115734)"

This reverts commit aac0052966.

* add setting for prevent closing the pinned tab when using middle click

* Adjust the description

* Adjust 'pinned' to 'sticky

* adjust prevent close pinned tab related code

* 💄

* some cleanup

* setting description

* fix logic

* 💄

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
This commit is contained in:
Hans
2023-07-28 15:42:56 +08:00
committed by GitHub
parent adbb91fe06
commit 55b75c5504
7 changed files with 69 additions and 20 deletions
@@ -176,6 +176,18 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
],
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'pinnedTabSizing' }, "Controls the size of pinned editor tabs. Pinned tabs are sorted to the beginning of all opened tabs and typically do not close until unpinned. This value is ignored when `#workbench.editor.showTabs#` is disabled.")
},
'workbench.editor.preventPinnedEditorClose': {
'type': 'string',
'enum': ['keyboardAndMouse', 'keyboard', 'mouse', 'never'],
'default': 'keyboardAndMouse',
'enumDescriptions': [
localize('workbench.editor.preventPinnedEditorClose.always', "Always prevent closing the pinned editor when using mouse middle click or keyboard."),
localize('workbench.editor.preventPinnedEditorClose.onlyKeyboard', "Prevent closing the pinned editor when using the keyboard."),
localize('workbench.editor.preventPinnedEditorClose.onlyMouse', "Prevent closing the pinned editor when using mouse middle click."),
localize('workbench.editor.preventPinnedEditorClose.never', "Never prevent closing a pinned editor.")
],
description: localize('workbench.editor.preventPinnedEditorClose', "Controls whether pinned editors should close when keyboard or middle mouse click is used for closing."),
},
'workbench.editor.splitSizing': {
'type': 'string',
'enum': ['auto', 'distribute', 'split'],
@@ -194,7 +206,7 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
},
'workbench.editor.focusRecentEditorAfterClose': {
'type': 'boolean',
'description': localize('focusRecentEditorAfterClose', "Controls whether tabs are closed in most recently used order or from left to right."),
'description': localize('focusRecentEditorAfterClose', "Controls whether editors are closed in most recently used order or from left to right."),
'default': true
},
'workbench.editor.showIcons': {