File tree 1 file changed +12
-0
lines changed
arduino-ide-extension/src/browser/theia/core
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';
17
17
import { SaveAsSketch } from '../../contributions/save-as-sketch' ;
18
18
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl' ;
19
19
import { nls } from '@theia/core/lib/common' ;
20
+ import URI from '@theia/core/lib/common/uri' ;
20
21
21
22
@injectable ( )
22
23
export class ApplicationShell extends TheiaApplicationShell {
@@ -41,6 +42,9 @@ export class ApplicationShell extends TheiaApplicationShell {
41
42
// Make the editor un-closeable asynchronously.
42
43
this . sketchesServiceClient . currentSketch ( ) . then ( ( sketch ) => {
43
44
if ( sketch ) {
45
+ if ( ! this . isSketchFile ( widget . editor . uri , sketch . uri ) ) {
46
+ return ;
47
+ }
44
48
if ( Sketch . isInSketch ( widget . editor . uri , sketch ) ) {
45
49
widget . title . closable = false ;
46
50
}
@@ -49,6 +53,14 @@ export class ApplicationShell extends TheiaApplicationShell {
49
53
}
50
54
}
51
55
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
+
52
64
async addWidget (
53
65
widget : Widget ,
54
66
options : Readonly < TheiaApplicationShell . WidgetOptions > = { }
You can’t perform that action at this time.
0 commit comments