mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Trigger notebook list rerender when whitespace is dismissed.
This commit is contained in:
parent
e3e0fe00a3
commit
c0300af60a
|
@ -295,8 +295,20 @@ export class NotebookCellListView<T> extends ListView<T> {
|
|||
}
|
||||
|
||||
removeWhitespace(id: string): void {
|
||||
this.notebookRangeMap.removeWhitespace(id);
|
||||
this.eventuallyUpdateScrollDimensions();
|
||||
const scrollTop = this.scrollTop;
|
||||
const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
|
||||
const currentPosition = this.notebookRangeMap.getWhitespacePosition(id);
|
||||
|
||||
if (currentPosition > scrollTop) {
|
||||
this.notebookRangeMap.removeWhitespace(id);
|
||||
this.render(previousRenderRange, scrollTop, this.lastRenderHeight, undefined, undefined, false);
|
||||
this._rerender(scrollTop, this.renderHeight, false);
|
||||
this.eventuallyUpdateScrollDimensions();
|
||||
} else {
|
||||
this.notebookRangeMap.removeWhitespace(id);
|
||||
this.eventuallyUpdateScrollDimensions();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getWhitespacePosition(id: string): number {
|
||||
|
|
Loading…
Reference in a new issue