renderers: Fix HexBytes formatter to apply padding also at the end of the string, ensuring proper output alignment when the pretty renderer justifies each line to the right

This commit is contained in:
Gustavo Moreira
2024-12-01 12:36:35 +11:00
parent 2dc1686289
commit 3c20e46902
+3 -1
View File
@@ -51,8 +51,10 @@ def hex_bytes_as_text(value: bytes, width: int = 16) -> str:
# Handle leftovers when the lenght is not mutiple of width
if printables:
output += " " * (width - len(printables))
padding = width - len(printables)
output += " " * (padding)
output += printables
output += " " * (padding)
return output