5
5
6
6
import { LazyStatefulPromise , raceTimeout } from 'vs/base/common/async' ;
7
7
import { onUnexpectedError } from 'vs/base/common/errors' ;
8
+ import { IMarkdownString } from 'vs/base/common/htmlContent' ;
8
9
import { IDisposable , DisposableStore , toDisposable } from 'vs/base/common/lifecycle' ;
9
10
import { deepClone } from 'vs/base/common/objects' ;
10
11
import { isDefined , isObject } from 'vs/base/common/types' ;
@@ -114,7 +115,12 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
114
115
modified : r . modifiedRef ? r . modifiedRef . object . textEditorModel : r . modifiedModel ! ,
115
116
title : r . title ,
116
117
get options ( ) {
117
- return computeOptions ( textResourceConfigurationService . getValue ( uri ) ) ;
118
+ r . modifiedRef ?. object . isReadonly ;
119
+
120
+ return {
121
+ ...getReadonlyConfiguration ( r . modifiedRef ?. object . isReadonly ( ) ?? true ) ,
122
+ ...computeOptions ( textResourceConfigurationService . getValue ( uri ) ) ,
123
+ } satisfies IDiffEditorOptions ;
118
124
} ,
119
125
onOptionsDidChange : h => this . _textResourceConfigurationService . onDidChangeConfiguration ( e => {
120
126
if ( e . affectsConfiguration ( uri , 'editor' ) || e . affectsConfiguration ( uri , 'diffEditor' ) ) {
@@ -127,6 +133,13 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
127
133
}
128
134
}
129
135
136
+ function getReadonlyConfiguration ( isReadonly : boolean | IMarkdownString | undefined ) : { readOnly : boolean ; readOnlyMessage : IMarkdownString | undefined } {
137
+ return {
138
+ readOnly : ! ! isReadonly ,
139
+ readOnlyMessage : typeof isReadonly !== 'boolean' ? isReadonly : undefined
140
+ } ;
141
+ }
142
+
130
143
function computeOptions ( configuration : IEditorConfiguration ) : IDiffEditorOptions {
131
144
const editorConfiguration = deepClone ( configuration . editor ) ;
132
145
0 commit comments