diff --git a/gtm b/gtm index 9898520..6aa4b5a 100755 --- a/gtm +++ b/gtm @@ -961,6 +961,11 @@ def draw_commit_details(stdscr, state: AppState, layout: StatusBarLayout): # Calculate positions right_x = layout.screen_width - len(author_branch_info) + # Calculate the message area boundaries + message_start_x = len(commit_info) + message_end_x = right_x - 1 + message_width = message_end_x - message_start_x - 2 # -2 for the pipe characters + # Always draw the author/branch info (it should fit now) if right_x >= len(commit_info): try: @@ -968,16 +973,27 @@ def draw_commit_details(stdscr, state: AppState, layout: StatusBarLayout): except curses.error: pass + # Draw left pipe character for message area + try: + stdscr.addstr(second_line, message_start_x, "|", curses.A_REVERSE) + except curses.error: + pass + # Draw the commit message in the remaining space - available_width = right_x - len(commit_info) - 1 first_line = message_lines[0] if message_lines else "" - if available_width > 0: - if len(first_line) > available_width: - first_line = first_line[:available_width-3] + "..." + if message_width > 0: + if len(first_line) > message_width: + first_line = first_line[:message_width-3] + "..." try: - stdscr.addstr(second_line, len(commit_info), first_line, curses.A_REVERSE) + stdscr.addstr(second_line, message_start_x + 1, first_line, curses.A_REVERSE) except curses.error: pass # Silently fail if we can't draw the message + + # Draw right pipe character for message area + try: + stdscr.addstr(second_line, message_end_x, "|", curses.A_REVERSE) + except curses.error: + pass # Draw additional lines of the commit message if we have more space for i, line in enumerate(message_lines[1:], 1): @@ -985,12 +1001,25 @@ def draw_commit_details(stdscr, state: AppState, layout: StatusBarLayout): if line_y >= layout.start_y + layout.total_height: break # No more space - # For continuation lines, indent them - line_available_width = layout.screen_width - 4 # Leave some margin - if len(line) > line_available_width: - line = line[:line_available_width-3] + "..." - - stdscr.addstr(line_y, 4, line, curses.A_REVERSE) + # For continuation lines, align them with the first line of the message + # and add pipe characters on both sides + try: + stdscr.addstr(line_y, message_start_x, "|", curses.A_REVERSE) + except curses.error: + pass + + if message_width > 0: + if len(line) > message_width: + line = line[:message_width-3] + "..." + try: + stdscr.addstr(line_y, message_start_x + 1, line, curses.A_REVERSE) + except curses.error: + pass + + try: + stdscr.addstr(line_y, message_end_x, "|", curses.A_REVERSE) + except curses.error: + pass def draw_search_mode(stdscr, state: AppState, layout: StatusBarLayout): """Draw search input interface"""