Skip to content

Commit c8441f2

Browse files
authored
Live upadtes to Notebook Cell EOL in troubleshooting (microsoft#254525)
1 parent 0e1bbe8 commit c8441f2

File tree

1 file changed

+9
-2
lines changed
  • src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot

1 file changed

+9
-2
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class TroubleshootController extends Disposable implements INotebookEdito
183183
overlayContainer.appendChild(topLine);
184184

185185
const getLayoutInfo = () => {
186-
const eol = cell.textModel?.getEOL() === '\n' ? 'LF' : 'CRLF';
186+
const eol = cell.textBuffer.getEOL() === '\n' ? 'LF' : 'CRLF';
187187
const scrollTop = this._notebookEditor.getAbsoluteTopOfElement(cell);
188188
return `cell #${index} (handle: ${cell.handle}) | AbsoluteTopOfElement: ${scrollTop}px | EOL: ${eol}`;
189189
};
@@ -230,7 +230,14 @@ export class TroubleshootController extends Disposable implements INotebookEdito
230230
this._localStore.add(cell.onDidChangeLayout((e) => {
231231
updateLayout();
232232
}));
233-
233+
this._localStore.add(cell.textBuffer.onDidChangeContent(() => {
234+
updateLayout();
235+
}));
236+
if (cell.textModel) {
237+
this._localStore.add(cell.textModel.onDidChangeContent(() => {
238+
updateLayout();
239+
}));
240+
}
234241
this._localStore.add(this._notebookEditor.onDidChangeLayout(() => {
235242
updateLayout();
236243
}));

0 commit comments

Comments
 (0)