File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,7 @@ function tabTitleFromURL(url: monaco.Uri | undefined): string {
293
293
294
294
class EditorPaneWidget extends Widget {
295
295
#editor: monaco . editor . IStandaloneCodeEditor ;
296
+ #model_ref: IRefernece < ITextEditorModel > ;
296
297
297
298
static createNode ( ) : HTMLElement {
298
299
const node = document . createElement ( "div" ) ;
@@ -307,6 +308,8 @@ class EditorPaneWidget extends Widget {
307
308
308
309
super ( { node : node } ) ;
309
310
311
+ this . #model_ref = model_ref ;
312
+
310
313
this . id = model_ref . object . textEditorModel ?. uri . toString ( ) ?? "" ;
311
314
312
315
this . #editor = monaco . editor . create ( this . contentNode , {
@@ -329,7 +332,8 @@ class EditorPaneWidget extends Widget {
329
332
330
333
dispose ( ) {
331
334
this . #editor. dispose ( ) ;
332
- this . dispose ( ) ;
335
+ this . #model_ref. dispose ( ) ;
336
+ super . dispose ( ) ;
333
337
}
334
338
335
339
protected get contentNode ( ) : HTMLDivElement {
@@ -420,7 +424,7 @@ export class EditorWidget extends Widget {
420
424
this . #url_mapper = null ;
421
425
422
426
if ( this . #tab_panel !== null ) {
423
- this . #layout . removeWidget ( this . #tab_panel ) ;
427
+ this . #tab_panel . dispose ( ) ;
424
428
}
425
429
this . #tab_panel = new TabPanel ( { addButtonEnabled : false } ) ;
426
430
this . #layout. addWidget ( this . #tab_panel) ;
You can’t perform that action at this time.
0 commit comments