File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/customEditor/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,14 +60,19 @@ export class CustomEditorModel extends Disposable implements ICustomEditorModel
6060 this . _onDidChangeDirty . fire ( ) ;
6161 }
6262
63- public async save ( options ?: ISaveOptions ) : Promise < boolean > {
64- this . _savePoint = this . _currentEditIndex ;
65- this . updateDirty ( ) ;
66-
63+ public async save ( _options ?: ISaveOptions ) : Promise < boolean > {
6764 const untils : Promise < any > [ ] = [ ] ;
6865 const handler = { waitUntil : ( until : Promise < any > ) => untils . push ( until ) } ;
69- this . _onWillSave . fire ( handler ) ;
70- await Promise . all ( untils ) ;
66+
67+ try {
68+ this . _onWillSave . fire ( handler ) ;
69+ await Promise . all ( untils ) ;
70+ } catch {
71+ return false ;
72+ }
73+
74+ this . _savePoint = this . _currentEditIndex ;
75+ this . updateDirty ( ) ;
7176
7277 return true ;
7378 }
You can’t perform that action at this time.
0 commit comments