| 379 | /** The parts a view shows of an opened area or file: the ones inside it, largest first, and the ones outside it. */ |
| 380 | parts: (items: readonly string[], total: number, scope: 'area' | 'file' = 'area', outside: readonly string[] = [], outsideTotal = outside.length) => { |
| 381 | const more = (listed: readonly string[], all: number) => all > listed.length ? `, +${count(all - listed.length)} more` : ''; |
| 382 | if (!outsideTotal) return `Parts shown (${count(total)}, largest first): ${items.join(', ')}${total > items.length ? `; ${count(total - items.length)} more` : ''}.`; |
| 383 | const inside = total ? `${count(total)} inside the ${scope}, largest first: ${items.join(', ')}${more(items, total)}; ` : ''; |
| 384 | return `Parts shown (${count(total + outsideTotal)}): ${inside}${count(outsideTotal)} outside it: ${outside.join(', ')}${more(outside, outsideTotal)}.`; |