This commit is contained in:
isidor 2019-10-02 15:55:10 +02:00
parent fb10f85b4c
commit a8a448d166

View file

@ -80,7 +80,7 @@ interface IPrivateReplService {
}
function revealLastElement(tree: WorkbenchAsyncDataTree<any, any, any>) {
tree.scrollTop = tree.scrollHeight - tree.renderHeight;
tree.scrollTop = Number.POSITIVE_INFINITY;
}
const sessionsToIgnore = new Set<IDebugSession>();
@ -799,8 +799,6 @@ class ReplDelegate implements IListVirtualDelegate<IReplElement> {
constructor(private configurationService: IConfigurationService) { }
getHeight(element: IReplElement): number {
const countNumberOfLines = (str: string) => Math.max(1, (str && str.match(/\r\n|\n/g) || []).length);
// Give approximate heights. Repl has dynamic height so the tree will measure the actual height on its own.
const config = this.configurationService.getValue<IDebugConfiguration>('debug');
const fontSize = config.console.fontSize;
@ -819,13 +817,13 @@ class ReplDelegate implements IListVirtualDelegate<IReplElement> {
return rowHeight;
}
let valueRows = value ? (countNumberOfLines(value) + Math.floor(value.length / 150)) : 0;
let valueRows = value ? Math.ceil(value.length / 150) : 0;
return rowHeight * valueRows;
}
if (element instanceof SimpleReplElement || element instanceof ReplEvaluationInput) {
let value = element.value;
let valueRows = countNumberOfLines(value) + Math.floor(value.length / 150);
let valueRows = Math.ceil(value.length / 150);
return valueRows * rowHeight;
}