refactor: Simplify commit details drawing by removing unnecessary try-except block

This commit is contained in:
n loewen 2025-06-08 09:26:52 +01:00 committed by n loewen (aider)
parent ecb59fa6c4
commit 328f0de01d
1 changed files with 31 additions and 34 deletions

5
gtm
View File

@ -931,7 +931,6 @@ def draw_commit_details(stdscr, state: AppState, layout: StatusBarLayout):
if not message_lines: if not message_lines:
message_lines = [""] message_lines = [""]
try:
# Draw on the second line of the status bar (layout.commit_detail_start_y) # Draw on the second line of the status bar (layout.commit_detail_start_y)
second_line = layout.commit_detail_start_y second_line = layout.commit_detail_start_y
@ -964,8 +963,6 @@ def draw_commit_details(stdscr, state: AppState, layout: StatusBarLayout):
line = line[:line_available_width-3] + "..." line = line[:line_available_width-3] + "..."
stdscr.addstr(line_y, 4, line, curses.A_REVERSE) stdscr.addstr(line_y, 4, line, curses.A_REVERSE)
except curses.error:
pass
def draw_search_mode(stdscr, state: AppState, layout: StatusBarLayout): def draw_search_mode(stdscr, state: AppState, layout: StatusBarLayout):
"""Draw search input interface""" """Draw search input interface"""
@ -1206,7 +1203,7 @@ def handle_mouse_input(stdscr, state: AppState) -> AppState:
# or very close to the same position (within 1-2 pixels) # or very close to the same position (within 1-2 pixels)
if (state.click_position and if (state.click_position and
abs(state.click_position[0] - mx) <= 2 and abs(state.click_position[0] - mx) <= 2 and
abs(state.click_position[1] - my) <= 2): abs(state.click_position[1] - my) <= 2): # TODO don't do this <= 2 thing
# This was a click, so switch panes (only if sidebar is visible) # This was a click, so switch panes (only if sidebar is visible)
focus = "right" focus = "right"
if state.show_sidebar: if state.show_sidebar: