Skip to content

Commit

Permalink
Mark only those commands ran using quick menu as recent
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Sharshakov <[email protected]>
  • Loading branch information
dsseng committed Apr 12, 2020
1 parent cb3db2a commit 82555f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/browser/quick-open/quick-command-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ export class CommandQuickOpenItem extends QuickOpenGroupItem {
// reset focus on the previously active element.
this.activeElement.focus({ preventScroll: true });
this.commands.executeCommand(this.command.id);

if (this.command) {
this.commands.addRecentCommand(this.command);
}
}, 50);
return true;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/common/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ export class CommandRegistry implements CommandService {
await this.fireWillExecuteCommand(commandId, args);
const result = await handler.execute(...args);
this.onDidExecuteCommandEmitter.fire({ commandId, args });
const command = this.getCommand(commandId);
if (command) {
this.addRecentCommand(command);
}
return result;
}
const argsMessage = args && args.length > 0 ? ` (args: ${JSON.stringify(args)})` : '';
Expand Down

0 comments on commit 82555f6

Please sign in to comment.