File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
arduino-ide-extension/src/browser/theia/core Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { Sketch } from '../../../common/protocol';
1717import { SaveAsSketch } from '../../contributions/save-as-sketch' ;
1818import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl' ;
1919import { nls } from '@theia/core/lib/common' ;
20+ import URI from '@theia/core/lib/common/uri' ;
2021
2122@injectable ( )
2223export class ApplicationShell extends TheiaApplicationShell {
@@ -41,6 +42,9 @@ export class ApplicationShell extends TheiaApplicationShell {
4142 // Make the editor un-closeable asynchronously.
4243 this . sketchesServiceClient . currentSketch ( ) . then ( ( sketch ) => {
4344 if ( sketch ) {
45+ if ( ! this . isSketchFile ( widget . editor . uri , sketch . uri ) ) {
46+ return ;
47+ }
4448 if ( Sketch . isInSketch ( widget . editor . uri , sketch ) ) {
4549 widget . title . closable = false ;
4650 }
@@ -49,6 +53,14 @@ export class ApplicationShell extends TheiaApplicationShell {
4953 }
5054 }
5155
56+ private isSketchFile ( uri : URI , sketchUriString : string ) : boolean {
57+ const sketchUri = new URI ( sketchUriString ) ;
58+ if ( uri . parent . isEqual ( sketchUri ) ) {
59+ return true ;
60+ }
61+ return false ;
62+ }
63+
5264 async addWidget (
5365 widget : Widget ,
5466 options : Readonly < TheiaApplicationShell . WidgetOptions > = { }
You can’t perform that action at this time.
0 commit comments