SCM - use subject as the title of the multi-file diff editor (#269347)

This commit is contained in:
Ladislau Szomoru
2025-10-01 16:55:05 +02:00
committed by GitHub
parent d51431eb17
commit 597148770d
5 changed files with 13 additions and 16 deletions

View File

@@ -295,6 +295,11 @@ export function truncate(value: string, maxLength = 20, ellipsis = true): string
return value.length <= maxLength ? value : `${value.substring(0, maxLength)}${ellipsis ? '\u2026' : ''}`;
}
export function subject(value: string): string {
const index = value.indexOf('\n');
return index === -1 ? value : truncate(value, index, false);
}
function normalizePath(path: string): string {
// Windows & Mac are currently being handled
// as case insensitive file systems in VS Code.