mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-21 07:39:51 +01:00
Ensure deleted cell in nb diff view is readonly
This commit is contained in:
@@ -773,7 +773,7 @@ abstract class SingleSideDiffElement extends AbstractElementRenderer {
|
||||
override readonly cell: SingleSideDiffElementViewModel;
|
||||
override readonly templateData: CellDiffSingleSideRenderTemplate;
|
||||
abstract get nestedCellViewModel(): DiffNestedCellViewModel;
|
||||
abstract get isEditable(): boolean;
|
||||
abstract get readonly(): boolean;
|
||||
constructor(
|
||||
notebookEditor: INotebookTextDiffEditor,
|
||||
cell: SingleSideDiffElementViewModel,
|
||||
@@ -915,9 +915,7 @@ abstract class SingleSideDiffElement extends AbstractElementRenderer {
|
||||
height: editorHeight
|
||||
}
|
||||
);
|
||||
if (this.isEditable) {
|
||||
this._editor.updateOptions({ readOnly: false });
|
||||
}
|
||||
this._editor.updateOptions({ readOnly: this.readonly });
|
||||
this.cell.editorHeight = editorHeight;
|
||||
|
||||
this._register(this._editor.onDidContentSizeChange((e) => {
|
||||
@@ -1092,7 +1090,7 @@ export class DeletedElement extends SingleSideDiffElement {
|
||||
get nestedCellViewModel() {
|
||||
return this.cell.original!;
|
||||
}
|
||||
get isEditable() {
|
||||
get readonly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1222,8 +1220,8 @@ export class InsertElement extends SingleSideDiffElement {
|
||||
get nestedCellViewModel() {
|
||||
return this.cell.modified!;
|
||||
}
|
||||
get isEditable() {
|
||||
return true;
|
||||
get readonly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
styleContainer(container: HTMLElement): void {
|
||||
|
||||
Reference in New Issue
Block a user