Update diff editor with new webview options
This commit is contained in:
parent
e56182e67f
commit
828f99eff5
1 changed files with 11 additions and 3 deletions
|
@ -41,7 +41,7 @@ import { generateUuid } from 'vs/base/common/uuid';
|
|||
import { IMouseWheelEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent';
|
||||
import { DiffNestedCellViewModel } from 'vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel';
|
||||
import { BackLayerWebView } from 'vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView';
|
||||
import { CELL_OUTPUT_PADDING } from 'vs/workbench/contrib/notebook/browser/constants';
|
||||
import { CELL_MARGIN, CELL_OUTPUT_PADDING, CELL_RUN_GUTTER, CODE_CELL_LEFT_MARGIN } from 'vs/workbench/contrib/notebook/browser/constants';
|
||||
import { NotebookDiffEditorEventDispatcher, NotebookDiffLayoutChangedEvent } from 'vs/workbench/contrib/notebook/browser/diff/eventDispatcher';
|
||||
|
||||
const $ = DOM.$;
|
||||
|
@ -389,8 +389,16 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
|
|||
}));
|
||||
}
|
||||
|
||||
private readonly webviewOptions = {
|
||||
outputNodePadding: CELL_OUTPUT_PADDING,
|
||||
outputNodeLeftPadding: 32,
|
||||
leftMargin: CODE_CELL_LEFT_MARGIN,
|
||||
cellMargin: CELL_MARGIN,
|
||||
runGutter: CELL_RUN_GUTTER
|
||||
};
|
||||
|
||||
private async _createModifiedWebview(id: string, resource: URI): Promise<void> {
|
||||
this._modifiedWebview = this.instantiationService.createInstance(BackLayerWebView, this, id, resource, { outputNodePadding: CELL_OUTPUT_PADDING, outputNodeLeftPadding: 32 }) as BackLayerWebView<IDiffCellInfo>;
|
||||
this._modifiedWebview = this.instantiationService.createInstance(BackLayerWebView, this, id, resource, this.webviewOptions) as BackLayerWebView<IDiffCellInfo>;
|
||||
// attach the webview container to the DOM tree first
|
||||
this._list.rowsContainer.insertAdjacentElement('afterbegin', this._modifiedWebview.element);
|
||||
await this._modifiedWebview.createWebview();
|
||||
|
@ -399,7 +407,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
|
|||
}
|
||||
|
||||
private async _createOriginalWebview(id: string, resource: URI): Promise<void> {
|
||||
this._originalWebview = this.instantiationService.createInstance(BackLayerWebView, this, id, resource, { outputNodePadding: CELL_OUTPUT_PADDING, outputNodeLeftPadding: 32 }) as BackLayerWebView<IDiffCellInfo>;
|
||||
this._originalWebview = this.instantiationService.createInstance(BackLayerWebView, this, id, resource, this.webviewOptions) as BackLayerWebView<IDiffCellInfo>;
|
||||
// attach the webview container to the DOM tree first
|
||||
this._list.rowsContainer.insertAdjacentElement('afterbegin', this._originalWebview.element);
|
||||
await this._originalWebview.createWebview();
|
||||
|
|
Loading…
Reference in a new issue