Git - more git blame code cleanup (#234739)

* Cleanup code

* Fix multi-file diff editor uri/title
This commit is contained in:
Ladislau Szomoru
2024-11-27 11:14:46 +01:00
committed by GitHub
parent ce446a0855
commit 2b1cfedf1e
6 changed files with 68 additions and 66 deletions

View File

@@ -288,6 +288,10 @@ export function detectUnicodeEncoding(buffer: Buffer): Encoding | null {
return null;
}
export function truncate(value: string, maxLength = 20): string {
return value.length <= maxLength ? value : `${value.substring(0, maxLength)}\u2026`;
}
function normalizePath(path: string): string {
// Windows & Mac are currently being handled
// as case insensitive file systems in VS Code.