fix: Show commit details on second status bar line when space available
This commit is contained in:
parent
1c5588470e
commit
c33866f12d
7
gtm
7
gtm
|
|
@ -146,7 +146,7 @@ class StatusBarLayout:
|
||||||
main_status_y=start_y, # Top line is main status
|
main_status_y=start_y, # Top line is main status
|
||||||
commit_detail_start_y=start_y + 1, # Commit details start below
|
commit_detail_start_y=start_y + 1, # Commit details start below
|
||||||
commit_detail_end_y=screen_height - 1, # Bottom line
|
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
|
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):
|
def draw_commit_details(stdscr, state: AppState, layout: StatusBarLayout):
|
||||||
"""Draw commit hash, message, author in the available space"""
|
"""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
|
return
|
||||||
|
|
||||||
commit_info = f" {state.commit_hash} "
|
commit_info = f" {state.commit_hash} "
|
||||||
|
|
@ -1006,6 +1006,9 @@ def draw_status_bars(stdscr, state):
|
||||||
|
|
||||||
if state.search_mode:
|
if state.search_mode:
|
||||||
draw_search_mode(stdscr, state, layout)
|
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:
|
else:
|
||||||
draw_main_status_line(stdscr, state, layout)
|
draw_main_status_line(stdscr, state, layout)
|
||||||
draw_commit_details(stdscr, state, layout)
|
draw_commit_details(stdscr, state, layout)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue