Skip to content

Commit 3d8e0e2

Browse files
committed
fixup! Fixes for Vscode Vim extension
1 parent 71200de commit 3d8e0e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/core/src/common/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export class CommandRegistry implements CommandService {
281281
return result;
282282
}
283283
const argsMessage = args && args.length > 0 ? ` (args: ${JSON.stringify(args)})` : '';
284-
throw new Error(`The command '${commandId}' cannot be executed. There are no active handlers available for the command.${argsMessage}`);
284+
throw Object.assign(new Error(`The command '${commandId}' cannot be executed. There are no active handlers available for the command.${argsMessage}`), { code: 'NO_ACTIVE_HANDLER' });
285285
}
286286

287287
protected async fireWillExecuteCommand(commandId: string): Promise<void> {

packages/plugin-ext/src/main/browser/command-registry-main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ export class CommandRegistryMainImpl implements CommandRegistryMain, Disposable
7676
try {
7777
return await this.delegate.executeCommand(id, ...args);
7878
} catch (e) {
79-
if (e.message.indexOf('There are no active handlers available for the command') === -1) {
79+
if ('code' in e && e['code'] === 'NO_ACTIVE_HANDLER') {
80+
return;
81+
} else {
8082
throw e;
8183
}
8284
}

0 commit comments

Comments
 (0)