mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Fix Tree Sticky Scroll compression with workbench.tree.stickyScrollMaxItemCount = 1
(#209005)
fix #204613
This commit is contained in:
parent
edfd5b8ba5
commit
16a32fa6c4
|
@ -192,18 +192,20 @@ class CompressibleStickyScrollDelegate<T, TFilterData> implements IStickyScrollD
|
||||||
if (stickyNodes.length === 0) {
|
if (stickyNodes.length === 0) {
|
||||||
throw new Error('Can\'t compress empty sticky nodes');
|
throw new Error('Can\'t compress empty sticky nodes');
|
||||||
}
|
}
|
||||||
|
const compressionModel = this.modelProvider();
|
||||||
if (!this.modelProvider().isCompressionEnabled()) {
|
if (!compressionModel.isCompressionEnabled()) {
|
||||||
return stickyNodes[0];
|
return stickyNodes[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect all elements to be compressed
|
// Collect all elements to be compressed
|
||||||
const elements: T[] = [];
|
const elements: T[] = [];
|
||||||
for (const stickyNode of stickyNodes) {
|
for (let i = 0; i < stickyNodes.length; i++) {
|
||||||
const compressedNode = this.modelProvider().getCompressedTreeNode(stickyNode.node.element);
|
const stickyNode = stickyNodes[i];
|
||||||
|
const compressedNode = compressionModel.getCompressedTreeNode(stickyNode.node.element);
|
||||||
|
|
||||||
if (compressedNode.element) {
|
if (compressedNode.element) {
|
||||||
if (compressedNode.element.incompressible) {
|
// if an element is incompressible, it can't be compressed with it's parent element
|
||||||
|
if (i !== 0 && compressedNode.element.incompressible) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
elements.push(...compressedNode.element.elements);
|
elements.push(...compressedNode.element.elements);
|
||||||
|
|
Loading…
Reference in a new issue