fix: Prevent resize handle from overwriting commit details

This commit is contained in:
n loewen (aider) 2025-06-08 09:23:21 +01:00
parent a8ac9c1e85
commit ecb59fa6c4
1 changed files with 4 additions and 2 deletions

4
gtm
View File

@ -998,6 +998,8 @@ def draw_resize_handle(stdscr, state: AppState, layout: StatusBarLayout):
if state.status_bar_height > 2:
handle_text += f" ({state.status_bar_height} lines)"
handle_x = layout.screen_width // 2 - len(handle_text) // 2
# Draw the handle on the main status line, but only if it won't overlap with other content
if handle_x > 0 and handle_x + len(handle_text) < layout.screen_width:
stdscr.addstr(layout.main_status_y, handle_x, handle_text, curses.A_REVERSE | curses.A_BOLD)
except curses.error:
pass
@ -1014,8 +1016,8 @@ def draw_status_bars(stdscr, state):
draw_commit_details(stdscr, state, layout)
else:
draw_main_status_line(stdscr, state, layout)
draw_resize_handle(stdscr, state, layout) # Draw handle before commit details
draw_commit_details(stdscr, state, layout)
draw_resize_handle(stdscr, state, layout)
def draw_ui(stdscr, state):
stdscr.erase()