fix: Show commit details on second status bar line when space available

This commit is contained in:
n loewen (aider) 2025-06-08 09:15:16 +01:00
parent 1c5588470e
commit c33866f12d
1 changed files with 5 additions and 2 deletions

7
gtm
View File

@ -146,7 +146,7 @@ class StatusBarLayout:
main_status_y=start_y, # Top line is main status
commit_detail_start_y=start_y + 1, # Commit details start below
commit_detail_end_y=screen_height - 1, # Bottom line
available_commit_lines=status_bar_height - 1,
available_commit_lines=max(0, status_bar_height - 1),
screen_width=screen_width
)
@ -919,7 +919,7 @@ def draw_main_status_line(stdscr, state: AppState, layout: StatusBarLayout):
def draw_commit_details(stdscr, state: AppState, layout: StatusBarLayout):
"""Draw commit hash, message, author in the available space"""
if not state.commit_hash:
if not state.commit_hash or layout.total_height < 2:
return
commit_info = f" {state.commit_hash} "
@ -1006,6 +1006,9 @@ def draw_status_bars(stdscr, state):
if state.search_mode:
draw_search_mode(stdscr, state, layout)
# Still show commit details in search mode if we have space
if layout.total_height > 1:
draw_commit_details(stdscr, state, layout)
else:
draw_main_status_line(stdscr, state, layout)
draw_commit_details(stdscr, state, layout)