mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-29 21:36:38 -04:00
Take row indentation into account when deciding to do line wrapping
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user