fix: Improve status bar commit message display and resizing

This commit is contained in:
n loewen (aider) 2025-06-08 09:00:28 +01:00
parent c2c678b8b3
commit 1bf45248bd
1 changed files with 9 additions and 3 deletions

12
gtm
View File

@ -268,6 +268,10 @@ def load_commit_content(state: AppState) -> AppState:
parts = commit_line.split(' ', 3) # Split into hash, date, time, message
short_message = parts[3] if len(parts) >= 4 else ""
# If commit_details['message'] is empty, use short_message as fallback
if not commit_details['message'].strip():
commit_details['message'] = short_message
max_scroll_new = max(0, len(file_lines) - (state.height - state.status_bar_height))
right_scroll_offset = state.right_scroll_offset
if reference_line:
@ -954,6 +958,8 @@ def draw_status_bars(stdscr, state):
try:
# Always draw the commit hash and first line of message on the bottom line
bottom_line = state.height - 1
# Draw the commit hash with bold
stdscr.addstr(bottom_line, 0, commit_info, curses.A_REVERSE | curses.A_BOLD)
# Draw the author and branch on the right of the bottom line
@ -983,7 +989,7 @@ def draw_status_bars(stdscr, state):
# Draw a handle for resizing the status bar
try:
handle_char = "≡" if state.dragging_status_bar else "="
handle_text = handle_char * 3
handle_text = handle_char * 5 # Make handle wider
if state.status_bar_height > 2:
handle_text += f" ({state.status_bar_height} lines)"
stdscr.addstr(status_bar_start, state.width // 2 - len(handle_text) // 2, handle_text, curses.A_REVERSE | curses.A_BOLD)
@ -1151,8 +1157,8 @@ def handle_mouse_input(stdscr, state: AppState) -> AppState:
if bstate & curses.BUTTON1_PRESSED:
if state.show_sidebar and abs(mx - state.divider_col) <= 1:
return replace(state, dragging_divider=True)
elif my == status_bar_start and abs(mx - (state.width // 2)) <= 2:
# Clicked on the status bar handle
elif my == status_bar_start and abs(mx - (state.width // 2)) <= 3:
# Clicked on the status bar handle (wider click area)
return replace(state, dragging_status_bar=True)
else:
focus = "right"