提交 edff39d1 编写于 作者: R Rob Lourens

Fix focusMode if cell has become unfocused while it was not rendered

Fix #129639
上级 c64d0477
......@@ -49,6 +49,11 @@ export class CodeCell extends Disposable {
const lineHeight = this.viewCell.layoutInfo.fontInfo?.lineHeight || 17;
const editorPadding = this.notebookEditor.notebookOptions.computeEditorPadding(this.viewCell.internalMetadata);
// patch up focusMode
if (this.viewCell.focusMode === CellFocusMode.Editor && this.notebookEditor.getActiveCell() !== this.viewCell) {
this.viewCell.focusMode = CellFocusMode.Container;
}
const editorHeight = this.viewCell.layoutInfo.editorHeight === 0
? lineNum * lineHeight + editorPadding.top + editorPadding.bottom
: this.viewCell.layoutInfo.editorHeight;
......@@ -91,10 +96,6 @@ export class CodeCell extends Disposable {
});
const updateForFocusMode = () => {
if (this.notebookEditor.getFocus().start !== this.notebookEditor.getCellIndex(viewCell)) {
templateData.container.classList.toggle('cell-editor-focus', viewCell.focusMode === CellFocusMode.Editor);
}
if (viewCell.focusMode === CellFocusMode.Editor && this.notebookEditor.getActiveCell() === this.viewCell) {
templateData.editor?.focus();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册