Take row indentation into account when deciding to do line wrapping

This commit is contained in:
2024-01-21 21:49:14 -05:00
parent c279711120
commit b4848b6db6
+1 -1
View File
@@ -59,7 +59,7 @@ func printFileEntry(entry string, lastSlash int, charCounter int, colorAlternato
// determine whether to wrap to a new line (+1 is to account for trailing spaces)
charCounter += len(fileEntryName) + 1
if charCounter >= width {
if charCounter+(indent*2) >= width {
charCounter = len(fileEntryName) + 1
fmt.Print("\n" + strings.Repeat(" ", indent*2)) // indent each line
}