Skip to content

When save operation is performed on a placeholder tab, we add that tab to the working set#2356

Merged
abose merged 1 commit intomainfrom
tabbar-fix
Aug 23, 2025
Merged

When save operation is performed on a placeholder tab, we add that tab to the working set#2356
abose merged 1 commit intomainfrom
tabbar-fix

Conversation

@devvaannsh
Copy link
Member

This PR ensures that when the save operation is performed we add the placeholder tab to the working set. This is the most intuitive UX as most mainline editors has this UX.

Note: When working on it, noticed that beforeExecuteCommand is not listening for any commands that is done through the UI. I mean that if the save/save all or any other similar operation is performed using the keyboard shortcut then it listened for those commands but when those operations are performed using the UI (File menu > Save) or anything similar, then beforeExecuteCommand was not listening to the commands.

Root cause: Found that the issue was because menu clicks were calling Command.prototype.execute() directly instead of using CommandManager.execute(). This was bypassing the command event system.

Fix: Changed the menu click handler in Menus.js to use CommandManager.execute() so that all commands (keyboard shortcuts AND menu clicks) go through the same path and trigger beforeExecuteCommand properly.

This PR doesn't break any existing functionality - just makes the command execution consistent.

@sonarqubecloud
Copy link

@abose abose merged commit 3080fb5 into main Aug 23, 2025
16 of 18 checks passed
@abose abose deleted the tabbar-fix branch August 23, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants