diff --git a/gtm b/gtm index 8b691e8..0221424 100755 --- a/gtm +++ b/gtm @@ -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)