Skip to content

Commit 368ea63

Browse files
author
Akos Kitta
committed
fix: make editor readonly if resource is readonly
Closes: #1501 Ref: eclipse-theia/theia#12354 Signed-off-by: Akos Kitta <[email protected]>
1 parent 28e00dd commit 368ea63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: arduino-ide-extension/src/browser/theia/monaco/monaco-text-model-service.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export class MonacoTextModelService extends TheiaMonacoTextModelService {
1919
const factory = this.factories
2020
.getContributions()
2121
.find(({ scheme }) => resource.uri.scheme === scheme);
22-
const readOnly = this.sketchesServiceClient.isReadOnly(resource.uri);
22+
const readOnly =
23+
Boolean(resource.isReadonly) ||
24+
this.sketchesServiceClient.isReadOnly(resource.uri);
2325
return factory
2426
? factory.createModel(resource)
2527
: new MaybeReadonlyMonacoEditorModel(

0 commit comments

Comments
 (0)