Skip to content

Commit ed1a42b

Browse files
committed
fix: unable to unpin tab in tab bar when its pinned using working files context menu
1 parent c78f41a commit ed1a42b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • src/extensionsIntegrated/TabBar

src/extensionsIntegrated/TabBar/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,10 @@ define(function (require, exports, module) {
524524
event.preventDefault();
525525
event.stopPropagation();
526526

527+
// we consciously enable the unpin command here, because if the tab is pinned,
528+
// the unpin command will be disabled by default as the last context menu item
529+
// and the user will not be able to unpin the tab
530+
CommandManager.get(Commands.FILE_UNPIN).setEnabled(true);
527531
CommandManager.execute(Commands.FILE_UNPIN, { file: fileObj, paneId: paneId });
528532
}
529533
});
@@ -550,6 +554,9 @@ define(function (require, exports, module) {
550554
if ($(event.target).hasClass("fa-times") || $(event.target).closest(".tab-close").length) {
551555
return;
552556
}
557+
if ($(event.target).hasClass("fa-thumbtack") || $(event.target).closest(".tab-pin").length) {
558+
return;
559+
}
553560

554561
// Get the file path from the data-path attribute of the parent tab
555562
const filePath = $(this).attr("data-path");

0 commit comments

Comments
 (0)