From b4848b6db6274b5221580ef166a9332e7429002e Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 21 Jan 2024 21:49:14 -0500 Subject: [PATCH] Take row indentation into account when deciding to do line wrapping --- src/entryList.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entryList.go b/src/entryList.go index c8c5b43..06e7dd7 100644 --- a/src/entryList.go +++ b/src/entryList.go @@ -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 }