mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 16:47:20 -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)
|
// determine whether to wrap to a new line (+1 is to account for trailing spaces)
|
||||||
charCounter += len(fileEntryName) + 1
|
charCounter += len(fileEntryName) + 1
|
||||||
if charCounter >= width {
|
if charCounter+(indent*2) >= width {
|
||||||
charCounter = len(fileEntryName) + 1
|
charCounter = len(fileEntryName) + 1
|
||||||
fmt.Print("\n" + strings.Repeat(" ", indent*2)) // indent each line
|
fmt.Print("\n" + strings.Repeat(" ", indent*2)) // indent each line
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user