From 3ae4865d345c87b8092d2422047b77f6b66d7e78 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 27 Jul 2016 09:19:03 +0200 Subject: [PATCH] fixes #9824 --- src/vs/workbench/parts/debug/common/debugModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 725a31fe66c..8457acc18d2 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -256,7 +256,7 @@ export abstract class ExpressionContainer implements debug.IExpressionContainer // There are a lot of children, create fake intermediate values that represent chunks #9537 const numberOfChunks = this.indexedVariables / ExpressionContainer.CHUNK_SIZE; for (let i = 0; i < numberOfChunks; i++) { - const chunkSize = (i < numberOfChunks - 1) ? ExpressionContainer.CHUNK_SIZE : this.indexedVariables % ExpressionContainer.CHUNK_SIZE; + const chunkSize = Math.min(ExpressionContainer.CHUNK_SIZE, this.indexedVariables - i * ExpressionContainer.CHUNK_SIZE); const chunkName = `${i * ExpressionContainer.CHUNK_SIZE}..${i * ExpressionContainer.CHUNK_SIZE + chunkSize - 1}`; childrenArray.push(new Variable(this, this.reference, chunkName, '', null, chunkSize, null, true, i)); }