Skip to content

Commit

Permalink
Support for VSCode Command workbench.action.revertAndCloseActiveEditor
Browse files Browse the repository at this point in the history
- Force close of editor in case document.revert fails

Signed-off-by: Ignacio Moreno <ignacio@genuitec.com>
  • Loading branch information
nmorenor committed Apr 30, 2020
1 parent 0649867 commit d2cbc4e
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -337,8 +337,12 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
if (editor) {
const monacoEditor = MonacoEditor.getCurrent(this.editorManager);
if (monacoEditor) {
await monacoEditor.document.revert();
editor.close();
try {
await monacoEditor.document.revert();
editor.close();
} catch (error) {
await this.shell.closeWidget(editor.id, { save: false });
}
}
}
}
Expand Down

0 comments on commit d2cbc4e

Please sign in to comment.