Ensure deleted cell in nb diff view is readonly

This commit is contained in:
Don Jayamanne
2024-08-08 12:58:41 +10:00
parent 9d5a68dde4
commit 7220c52636
@@ -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 {