Skip to content

Commit 310a8ed

Browse files
committed
month concat text bug fixed
1 parent 62d61fd commit 310a8ed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/gitfetch/display.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,14 @@ def _build_month_line_spaced(self, weeks_data: list) -> str:
550550
# New month - add spacing and month name
551551
target_width = (idx + 1) * 2
552552
current_width = len(month_line)
553-
needed_space = target_width - current_width
554-
if needed_space > 0:
555-
month_line += " " * (
556-
needed_space - len(months[
557-
current_month - 1
558-
])
559-
)
560-
month_line += months[current_month - 1]
553+
# Ensure at least 1 space between months
554+
month_name = months[current_month - 1]
555+
calc = (target_width -
556+
current_width -
557+
len(month_name))
558+
needed_space = max(1, calc)
559+
month_line += " " * needed_space
560+
month_line += month_name
561561
except ValueError:
562562
pass
563563

0 commit comments

Comments
 (0)